I've been a professional C, Perl, PHP and Python developer.
I'm an ex-sysadmin from the late 20th century.
These days I do more Javascript and CSS and whatnot, and promote UX and accessibility.
You should put spaces between the test brackets and the test conditions like [ -f foo.txt ] otherwise you'll get a command not found error.
The environment variable one is over-complicated - you don't need the else, and you don't need to use false to ensure that the last command is run if you use a semicolon:
# longif[[-z"${CIRCLE_BRANCH}"]];then
npm run redis-cli flushall
fi
npm run sync# one-liner[-z"${CIRCLE_BRANCH}"]&& npm run redis-cli flushall; npm run sync
You should put spaces between the test brackets and the test conditions like
[ -f foo.txt ]
otherwise you'll get acommand not found
error.The environment variable one is over-complicated - you don't need the else, and you don't need to use
false
to ensure that the last command is run if you use a semicolon:Thanks I've updated it.