forked from trailofbits/eth-security-toolbox
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsolc-select
More file actions
executable file
·32 lines (26 loc) · 774 Bytes
/
solc-select
File metadata and controls
executable file
·32 lines (26 loc) · 774 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
#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "Usage: $0 [--list | VERSION]"
echo ""
echo " VERSION switches the default version of solc to the specified version"
echo ""
echo " --list, -l lists all installed versions of solc"
echo ""
exit 1
fi
SOLC_INSTALL_DIR=/usr/bin
VERSION=$1
if [ "$VERSION" = "--list" ] || [ "$VERSION" = "-l" ]; then
find $SOLC_INSTALL_DIR -name 'solc-v*' -printf "%f\n" | awk -F'v' '{print $2}' | sort
exit 0
fi
SOLC_PATH=$SOLC_INSTALL_DIR/solc-v$VERSION
if [ ! -f $SOLC_PATH ]; then
echo "Error: ${SOLC_PATH} does not exist!"
echo ""
echo "Please select one of the installed versions:"
echo ""
echo `$0 --list`
exit 1
fi
ln -fs $SOLC_PATH $HOME/.local/bin/solc