forked from mithro/media2iki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrename-helper.sh
32 lines (23 loc) · 989 Bytes
/
rename-helper.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh
# This is an in-progress shell script... Use at your own risk!
# HoboAptana-20070823-044146 -> HoboIntro-20070823-044146
# Tools/HTML-20060930-174924 -> HTML-20060930-174922
#OLD=Git/git-svn-20070920-181338
#NEW=Git-svn-20070920-181338
#OLD_BASE='Git/git-svn'
#NEW_BASE=Git-svn
#OLD_ESC_BASE='Git\/git-svn'
#NEW_ESC_BASE=Git-svn
OLD="Dpkg/Create the Repository-20061207-202353"
NEW="Dpkg/Apt-20061207-202352"
# TODO: automatically generate these...
# Just the file name, with the -12345678-123456 removed
OLD_BASE="Dpkg/Create the Repository"
NEW_BASE="Dpkg/Apt"
# Just the base name but with all / converted to \/
OLD_ESC_BASE="Dpkg\/Create the Repository"
NEW_ESC_BASE="Dpkg\/Apt"
# This just prints the filenames
# find . -wholename "./$NEW_BASE-*" \! -newer "$NEW" -and \! -samefile "$NEW" -print
find . -wholename "./$NEW_BASE-*" \! -newer "$NEW" -and \! -samefile "$NEW" -print | \
sed "s/.\/$NEW_ESC_BASE-\(.*\)/git mv '$NEW_ESC_BASE-\1' '$OLD_ESC_BASE-\1'/"