diff options
author | Ori Bernstein <ori@eigenstate.org> | 2021-06-14 00:00:37 +0000 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2021-06-14 00:00:37 +0000 |
commit | a73a964e51247ed169d322c725a3a18859f109a3 (patch) | |
tree | 3f752d117274d444bda44e85609aeac1acf313f3 /sys/src/cmd/python/Tools/faqwiz/move-faqwiz.sh | |
parent | e64efe273fcb921a61bf27d33b230c4e64fcd425 (diff) |
python, hg: tow outside the environment.
they've served us well, and can ride off into the sunset.
Diffstat (limited to 'sys/src/cmd/python/Tools/faqwiz/move-faqwiz.sh')
-rwxr-xr-x | sys/src/cmd/python/Tools/faqwiz/move-faqwiz.sh | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/sys/src/cmd/python/Tools/faqwiz/move-faqwiz.sh b/sys/src/cmd/python/Tools/faqwiz/move-faqwiz.sh deleted file mode 100755 index 6a708aa25..000000000 --- a/sys/src/cmd/python/Tools/faqwiz/move-faqwiz.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# -# Christian Reis <kiko@async.com.br> -# -# Moves -# -# Example: -# -# blackjesus:~> ./move-faqwiz.sh 2\.1 3\.2 -# Moving FAQ question 02.001 to 03.002 - -if [ x$2 == x ]; then - echo "Need 2 args: original_version final_version." - exit 2 -fi - -if [ ! -d data -o ! -d data/RCS ]; then - echo "Run this inside the faqwiz data/ directory's parent dir." - exit 2 -fi - -function cut_n_pad() { - t=`echo $1 | cut -d. -f $2` - export $3=`echo $t | awk "{ tmp = \\$0; l = length(tmp); for (i = 0; i < $2-l+1; i++) { tmp = "0".tmp } print tmp }"` -} - -cut_n_pad $1 1 prefix1 -cut_n_pad $1 2 suffix1 -cut_n_pad $2 1 prefix2 -cut_n_pad $2 2 suffix2 -tmpfile=tmp$RANDOM.tmp -file1=faq$prefix1.$suffix1.htp -file2=faq$prefix2.$suffix2.htp - -echo "Moving FAQ question $prefix1.$suffix1 to $prefix2.$suffix2" - -sed -e "s/$1\./$2\./g" data/$file1 > ${tmpfile}1 -sed -e "s/$1\./$2\./g" data/RCS/$file1,v > ${tmpfile}2 - -if [ -f data/$file2 ]; then - echo "Target FAQ exists. Won't clobber." - exit 2 -fi - -mv ${tmpfile}1 data/$file2 -mv ${tmpfile}2 data/RCS/$file2,v -mv data/$file1 data/$file1.orig -mv data/RCS/$file1,v data/RCS/$file1,v.orig - |