Skip to content

Instantly share code, notes, and snippets.

@okram999
Last active April 21, 2016 17:05
Show Gist options
  • Save okram999/dec8694ba58da0623b71cbc2af6a5fd8 to your computer and use it in GitHub Desktop.
Save okram999/dec8694ba58da0623b71cbc2af6a5fd8 to your computer and use it in GitHub Desktop.
groovy-loop-with-2-variables
def paths = ['some_path1', 'some_path2', 'another_path']
def dirs = ['dir1', 'dir_for_some_path2', 'another_dir']
[paths, dirs].transpose().each { path, dir ->
bat "xcopy %cd%${path}\\obj\\Lab5\\Package\\PackageTmp host1\\${dir} /E /Y /V"
bat "(robocopy %cd%${Path}${Another_fixed_path} ${Another_fixed_path}\\${dir} file1 file2) ^& IF %ERRORLEVEL% LEQ 7 exit 0"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment