Last active
May 2, 2019 07:03
-
-
Save JimBobSquarePants/30757c2b7588d84cfb84750d24d4d6f0 to your computer and use it in GitHub Desktop.
cmd to bash???
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo Off | |
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& '.\build.ps1'" | |
if not "%errorlevel%"=="0" goto failure | |
:success | |
ECHO successfully built project | |
REM exit 0 | |
goto end | |
:failure | |
ECHO failed to build. | |
REM exit -1 | |
goto end | |
:end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& '.\build.ps1'" | |
if $errorlevel != "0" ; | |
then goto failure | |
fi | |
:success | |
echo successfully built project | |
# exit 0 | |
goto end | |
:failure | |
echo failed to build. | |
# exit -1 | |
goto end | |
:end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A good place to start with checking shell scripts is Shell check. They help you catch all sorts of nasty possibilities before hand.
Its also worthwhile giving this a read. Talks about how to setup "strict mode" when writing shell scripts.
Also this looks more like a "transliteration" than a "translation" from the PS script. Which is a great place to start but not really idiomatic. Here's how I'd approach writing this (might also not be the best way)
Would be more than happy to help out more :)
Welcome to the beautiful (yet sometimes painful) world of shells scripts!