-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpublicize
More file actions
executable file
·56 lines (52 loc) · 940 Bytes
/
publicize
File metadata and controls
executable file
·56 lines (52 loc) · 940 Bytes
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
#!/bin/bash
PUBLIC_REPOSITORY=${HOME}/public-scripts
if test ! -d ${PUBLIC_REPOSITORY}; then
CREATE_REPO=
while [ -z "$CREATE_REPO" ]; do
echo
read -p "public-script repository not found in ${HOME} directory. Create one now? (y/n): " CREATE_REPO
CREATE_REPO=${CREATE_REPO,,}
case $CREATE_REPO in
y)
mkdir $PUBLIC_REPOSITORY
EXIT_LOOP=true
;;
n)
echo Cannot continue!
exit
;;
*)
echo response not recognized!
CREATE_REPO=
;;
esac
done
fi
if test ! -f ${1}; then
echo
echo ${1} does not appear to exist!
exit
fi
COPY_FILE=
while [ -z "$COPY_FILE" ]; do
echo
read -p "Copy ${1} to public-scripts repository? (y/n): " COPY_FILE
COPY_FILE=${COPY_FILE,,}
case $COPY_FILE in
y)
cp ${1} ${HOME}/public-scripts
echo
exit
;;
n)
echo Action cancelled!
echo
exit
;;
*)
echo Response not recognized! Try again.
echo
COPY_FILE=
;;
esac
done