Skip to content

Commit

Permalink
Adapt windows when use download_solc.sh to download solc (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
sulenn authored Jul 3, 2020
1 parent a9124fe commit 365a10c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .ci/integration_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ integration_gm()
LOG_INFO "generate hello_gm.go and build hello_gm done."

bash build_chain.sh -l 127.0.0.1:4 -g -o nodes_gm
cp nodes_gm/127.0.0.1/sdk/* ./
cp -r nodes_gm/127.0.0.1/sdk/* ./
bash nodes_gm/127.0.0.1/start_all.sh
sed -i "s/SMCrypto=false/SMCrypto=true/g" config.toml
sed -i "s#KeyFile=\".ci/0x83309d045a19c44dc3722d15a6abd472f95866ac.pem\"#KeyFile=\".ci/sm2p256v1_0x791a0073e6dfd9dc5e5061aebc43ab4f7aa4ae8b.pem\"#g" config.toml
Expand Down
20 changes: 13 additions & 7 deletions tools/download_solc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ install_path="${HOME}/.fisco"
version="0.4.25"
OS="linux"
crypto=
extension=

LOG_WARN()
{
Expand Down Expand Up @@ -33,10 +34,14 @@ exit 0
check_env() {
if [ "$(uname)" == "Darwin" ];then
OS="mac"
fi
if [ "$(uname -m)" != "x86_64" ];then
elif [ "$(uname -s)" == "Linux" ];then
OS="linux"
elif [ "$(uname -m)" != "x86_64" ];then
LOG_WARN "We only offer x86_64 precompiled solc binary, your OS architecture is not x86_64. Please compile from source."
exit 1
else
OS="win"
extension=".exe"
fi
}

Expand All @@ -61,17 +66,18 @@ main()

if [ ! -f "${install_path}/solc-${version}${crypto}" ];then
if curl -LO "${download_link}" ;then
tar -zxf "${package_name}"
tar -zxf "${package_name}"
rm -rf "${package_name}"
mkdir -p "${install_path}"
mv solc "${install_path}/solc-${version}${crypto}"
else
LOG_WARN "Download from ${download_link} failed, please retry."
exit 1
fi
mv "solc${extension}" "${install_path}/solc-${version}${crypto}${extension}"
fi
if [ ! -f "./solc-${version}${crypto}" ];then
ln -s "${install_path}/solc-${version}${crypto}${extension}" "./solc-${version}${crypto}"
fi
ln -s "${install_path}/solc-${version}${crypto}" "./solc-${version}${crypto}"

}

print_result()
Expand All @@ -88,4 +94,4 @@ print_result()
parse_params "$@"
check_env
main
print_result
print_result

0 comments on commit 365a10c

Please sign in to comment.