]> git.pld-linux.org Git - packages/adapter.git/blob - adapter.sh
- just sh, no bashizm
[packages/adapter.git] / adapter.sh
1 #!/bin/sh
2
3 if [ $# -ne 1 -o ! -f "$1" ]; then
4   echo "Usage: $0 filename"
5   exit 1
6 fi
7
8 ./adapter.awk "$1" > "$1.adapter"
9 diff -u "$1" "$1.adapter" | less
10 echo -n "Are the changes OK? [yNso] "
11
12 read OK
13
14 if [ "$OK" = "y" -o "$OK" = "Y" ]; then
15   echo "Committing..."
16   mv "$1.adapter" "$1"
17   cvs ci "$1"
18 elif [ "$OK" = "o" -o "$OK" = "O" ];then
19   echo "Saving changes..."
20   mv "$1.adapter" "$1"
21 elif [ "$OK" != "s" -a "$OK" != "S" ];then
22   echo "Ignoring changes..."
23   rm "$1.adapter"
24 else
25   echo "Did nothing."
26 fi
This page took 0.028091 seconds and 4 git commands to generate.