-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathupdate
executable file
·80 lines (59 loc) · 2.01 KB
/
update
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
if [ $# -eq 0 ]
then
case $(uname -s) in
Linux*) machine=Linux;;
Darwin*) machine=Mac;;
CYGWIN*) machine=Cygwin;;
MINGW*) machine=MinGw;;
*) machine="UNKNOWN:${unameOut}"
esac
echo "Updating SPICE models for $machine (you can also supply your\
own LTSpice lib path in case this script fails)\n"
case $machine in
Mac)
LTSPICE_LIB_PATH=$HOME'/Library/Application Support/LTspice/lib'
;;
Linux)
LTSPICE_LIB_PATH="$HOME/Documents/LTspiceXVII/lib"
;;
CYGWIN | MINGW)
echo "WINDOWS NOT SETUP YET\n"
echo "Instead of running ./update, you can run\n $ ./update /path/to/LTspice/lib \n"
exit 1
;;
*)
echo unknown type $machine
echo "Instead of running ./update, you can run\n $ ./update /path/to/LTspice/lib \n"
exit 1
;;
esac
echo "Updating $LTSPICE_LIB_PATH\n"
else
LTSPICE_LIB_PATH=$1
echo "Updating $LTSPICE_LIB_PATH\n"
if [ ! -d ${LTSPICE_LIB_PATH}/sym ]
then
# the directory $LTSPICE_LIB_PATH/sym doesn't exits which probably means
# the wrong path was suppploed.
echo The wrong path was supplied. Make sure you gave the path to the /lib library
exit 1
fi
fi
if [[ ! -d ${LTSPICE_LIB_PATH}/sym ]]
then
echo The wrong path was supplied. Try running the commands
echo " ./update [path to ltspice lib folder]"
echo and seeing if that works.
exit 1
fi
# prep the SPICE directory by clearing previous installations
rm -rf "${LTSPICE_LIB_PATH}/sym/qnn-spice"
rm -rf "${LTSPICE_LIB_PATH}/sub/qnn-spice"
# if there are ever nested submodules, add --recursive to
# this and other relevant commands
git submodule update --init
# git pull and git submodule update --remote
git submodule foreach "git pull || true"
echo
# runs the update_helper python script on every subdirectory
git submodule foreach python3 ../update_helper.py --update-symlinks "${LTSPICE_LIB_PATH}"