mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
20 lines
686 B
Bash
Executable File
20 lines
686 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
# shellcheck source=scripts/common.sh
|
|
source "${REPO_ROOT}/scripts/common.sh"
|
|
|
|
SOLTMPDIR=$(mktemp -d -t "cmdline-test-overwriting-files-XXXXXX")
|
|
|
|
# First time it works
|
|
echo 'contract C {}' | msg_on_error --no-stderr "$SOLC" - --bin -o "$SOLTMPDIR/non-existing-stuff-to-create"
|
|
|
|
# Second time it fails
|
|
echo 'contract C {}' | "$SOLC" - --bin -o "$SOLTMPDIR/non-existing-stuff-to-create" 2>/dev/null && \
|
|
fail "solc did not refuse to overwrite $SOLTMPDIR/non-existing-stuff-to-create."
|
|
|
|
# Unless we force
|
|
echo 'contract C {}' | msg_on_error --no-stderr "$SOLC" - --overwrite --bin -o "$SOLTMPDIR/non-existing-stuff-to-create"
|
|
|
|
rm -r "$SOLTMPDIR"
|