Last active
August 29, 2015 14:03
-
-
Save sdesalas/bdc77ecf852ec0cd34c9 to your computer and use it in GitHub Desktop.
Ignores errors when copying a folder that doesnt exist
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
:: 1) Connect to remote server | |
net use \\fileserver\packages\myproject | |
:: 2) Backup previous package | |
move /y "\\fileserver\packages\myproject\prod\${APP_VERSION}\" "\\fileserver\packages\myproject\prod\${APP_VERSION}.#${releasetag}" | |
if %%errorlevel%% GEQ 1 goto filenotfound | |
goto okay | |
:: 3) Ignore errors | |
:filenotfound | |
rem Ignoring File-not-Found errors.. | |
:okay | |
:: 4) Recreate directory | |
mkdir "\\fileserver\packages\myproject\prod\${APP_VERSION}\" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Useful for backup scripts that dont fall over when project structure hasnt been created yet.