Run for version in 1.16 1.17 1.18 1.19 1.20 1.21; do for version in 1.16 1.17 1.18 1.19…
- User
Run for version in 1.16 1.17 1.18 1.19 1.20 1.21; do for version in 1.16 1.17 1.18 1.19 1.20 1.21; do ( cd version-Dev-{{ steps.get_latest_release.outputs.next_version }}.zip ./* cd .. zip -r Rus-For-Mods-$version-Dev-1.zip pack.png PeruseOrBruise.txt ) done shell: /usr/bin/bash -e {0} /home/runner/work/_temp/215197c1-f11b-45a0-831a-fbb09b015fcc.sh: line 3: cd: too many arguments Error: Process completed with exit code 1.
- Assistant
The error
"cd: too many arguments"indicates that the commandcdis receiving more input than it expects. This is likely because you are using a*wildcard which expands to multiple directories or files, causingcdto fail.Also, there are nested
forloops with the same variable nameversion. This would cause problems as the inner loop would overwrite theversionvalue of the outer loop. It looks like you want to iterate and run commands for multiple versions, so we need to properly scope the iteration variable and handle navigation appropriately.Here is the corrected script:
for version_outer in 1.16 1.17 1.18 1.19 1.20 1.21; do ( cd $version_outer || exit zip -r "../Rus-For-Mods-$version_outer-Dev-{{ steps.get_latest_release.outputs.next_version }}.zip" ./* cd .. zip -r "Rus-For-Mods-$version_outer-Dev-1.zip" pack.png PeruseOrBruise.txt ) doneExplanation:
- Changed the
versionvariable toversion_outerto avoid conflicts with nested for loops (which are not needed in your script). - Removed the unnecessary nested
forloop. - Added the
|| exitto ensure the script stops if changing to a directory fails. - Wrapped the zipped file names in double quotes to handle any spaces in paths.
- Corrected the path for where the zipping occurs, ensuring proper relative paths.
Make sure that the wildcard
*incd $version_outer/*points to a single subdirectory or adjust accordingly if your directories are structured differently. If you need to handle multiple subdirectories, consider additional logic or another approach to target exactly one directory. - Changed the
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.