-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsync_file
executable file
·51 lines (40 loc) · 1.28 KB
/
sync_file
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
#!/bin/bash
# Used to sync files between local source directories, run in source root
# usage: sync_file [file] (-p [source prefix])?
# ========================= static configuration
# name of this script
THISEXEC="sync_file"
# the directory containing source trees $HOMEDIR/cvc5-*
HOMEDIR="/home/andrew"
# ========================= end static configuration
echo "=== sync_file $@"
# to be run in source directory $HOMEDIR/cvc5-*/. AU
# ========================= compute source suffix
CURRDIR=$(pwd)
BASEDIR="$HOMEDIR/cvc5"
echo "rexec: This directory is $CURRDIR"
if [[ $CURRDIR != $BASEDIR* ]]; then
echo "rexec: ERROR: not a git root directory"
exit 1;
fi
SRCSUFFIX=${CURRDIR#"$BASEDIR"}
if [ ! -z $SRCSUFFIX ]; then
SRCSUFFIX=${SRCSUFFIX#"-"}
fi
echo "rexec: with directory suffix \"$SRCSUFFIX\""
# ========================= end compute source suffix
FILENAME=$1
shift
PULLPREFIX=$1
shift
# ========================= get the source directory
if [ ! -z $PULLPREFIX ]; then
SRCDIR="$HOMEDIR/cvc5-$PULLPREFIX"
else
SRCDIR="$HOMEDIR/cvc5"
fi
echo "$SERVEREXEC: pull prefix is \"$PULLPREFIX\""
echo "$SERVEREXEC: source directory is $SRCDIR"
# ========================= end get the source directory
echo "$SERVEREXEC: EXEC: cp $SRCDIR/$FILENAME ./$FILENAME"
cp $SRCDIR/$FILENAME ./$FILENAME