-
Notifications
You must be signed in to change notification settings - Fork 0
/
unicly-move-to-git.sh
executable file
·119 lines (107 loc) · 2.62 KB
/
unicly-move-to-git.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#!/bin/sh
#!/bin/zsh
#
#
### ==============================
### :FILE-CREATED <Timestamp: #{2011-04-20T19:24:08-04:00Z}#{11163} - by MON KEY>
### :FILE unicly/unicly-move-to-git.sh
### ==============================
### :NOTE This script won't work unless $DEVHOME is in your environment
### elisp> (getenv "DEVHOME")
### shell> $DEVHOME
###
### No doubt there are better ways of doing this with a shell script, but...
### I F*CKING HATE SHELL SCRIPTING!!!
### ==============================
CL_MON_CODE=$DEVHOME/CL-MON-CODE
UNICLY_SRC=$CL_MON_CODE/unicly
UNICLY_GIT=$CL_MON_CODE/unicly-GIT
# TESTING
#NOT_GIT_DIR=$UNICLY_GIT/non-existent-dir
UNICLY_FILES="unicly.asd
package.lisp
unicly-extend.lisp
unicly-bit-vectors.lisp
unicly-bridge.lisp
unicly-byte-arrays.lisp
unicly-class.lisp
unicly-compat.lisp
unicly-conditions.lisp
unicly-deprecated.lisp
unicly-docs.lisp
unicly-hash-table.lisp
unicly-integers.lisp
unicly-io.lisp
unicly-loadtime-bind.lisp
unicly-macros.lisp
unicly-null-check.lisp
unicly-specials.lisp
unicly-string-uuid.lisp
unicly-tests.lisp
unicly-timings.lisp
unicly-types.lisp
unicly-uuid-version.lisp
unicly-utils.lisp
unicly.lisp
LICENSE.txt
README
LISPWORKS
make-unicly-etags.sh
unicly-move-to-git.sh"
cd $UNICLY_SRC
ensure_abort_dirs ()
{
for j in `echo "$UNICLY_SRC $UNICLY_GIT"`;do
if [ ! -d "$j" ]
then
echo "A required directory was non-existent: $j";
printf "\tdeclining to proceed further\n";
exit 1;
fi
done;
}
ensure_readme ()
{
if [ ! -e $UNICLY_GIT/README ]
then
echo "Creaating empty README file: $UNICLY_GIT/README"
echo
touch $UNICLY_GIT/README
fi
}
copy_unicly_files ()
{
for f in $UNICLY_FILES; do
if [ ! -e "$UNICLY_SRC/$f" ] # Check if file exists.
then
echo ":FILE $UNICLY_SRC/$f does not exist";
echo
else # On to next.
cp "$UNICLY_SRC/$f" "$UNICLY_GIT/$f";
echo "Copied :FILE $f";
echo "From :SOURCE $UNICLY_SRC/ to :DEST $UNICLY_GIT/";
echo
fi
done;
}
etags_after_copy ()
{
cd $UNICLY_SRC
find . -name '*.lisp' -print | xargs etags -o ./TAGS --language=lisp
echo "etags created $UNICLY_SRC/TAGS"
echo
# Don't copy tags from source directory!
# cp $UNICLY_SRC/TAGS $UNICLY_GIT/TAGS
# echo "Copied :FILE $UNICLY_SRC/TAGS --> $UNICLY_GIT/TAGS"
cd $UNICLY_GIT
find . -name '*.lisp' -print | xargs etags -o ./TAGS --language=lisp
echo "etags created :FILE $UNICLY_GIT/TAGS"
echo
}
ensure_abort_dirs
copy_unicly_files
ensure_readme
etags_after_copy
exit 0
### ==============================
### EOF