Open kevinlu1248 opened 1 year ago
💎 Sweep Pro: I'm creating this ticket using GPT-4. You have unlimited GPT-4 tickets.
I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.
I'm creating the following subissues:
* In packages/blobs/grub/09_linux_with_dtb.sh, replace all instances of the 'x-hack' with a more modern approach. * In packages/bsp/nanopim4/nanopim4-pwm-fan.sh, replace all instances of the 'x-hack' with a more modern approach. * In lib/tools/shellcheck.sh, replace all instances of the 'x-hack' with a more modern approach. * In lib/functions/artifacts/artifact-armbian-bsp-cli.sh, replace all instances of the 'x-hack' with a more modern approach. * In lib/functions/artifacts/artifact-firmware.sh, replace all instances of the 'x-hack' with a more modern approach.
* In lib/functions/rootfs/distro-specific.sh, replace all instances of the 'x-hack' with a more modern approach. * In lib/functions/artifacts/artifacts-obtain.sh, replace all instances of the 'x-hack' with a more modern approach. * In lib/functions/artifacts/artifacts-reversion.sh, replace all instances of the 'x-hack' with a more modern approach. * In lib/functions/artifacts/artifact-uboot.sh, replace all instances of the 'x-hack' with a more modern approach. * In lib/functions/artifacts/artifact-armbian-base-files.sh, replace all instances of the 'x-hack' with a more modern approach.
* In lib/functions/cli/entrypoint.sh, replace all instances of the 'x-hack' with a more modern approach. * In lib/functions/cli/commands.sh, replace all instances of the 'x-hack' with a more modern approach. * In lib/functions/artifacts/artifact-rootfs.sh, replace all instances of the 'x-hack' with a more modern approach. * In lib/functions/artifacts/artifact-kernel.sh, replace all instances of the 'x-hack' with a more modern approach. * In lib/functions/artifacts/artifact-full_firmware.sh, replace all instances of the 'x-hack' with a more modern approach.
I finished creating the subissues! Track them at:
🎉 Latest improvements to Sweep:
💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. Join Our Discord
x-hack is a shell/bash conditional using any letter (often 'x' thus the 'x-hack' name) followed by variable declaration ${var} and checking against the same letter followed by value such as:
This was done to ensure compatibility across different shells and systems many years ago, but today it's obsolete as the shells evolved enough to be more reliable.
That said the armbian codebase is still using them for some reason and it was agreed that these should be replaced so i want you to look through the codebase and fix all x-hacks.
Note that the declaration can also be written without quotes:
Or even checking for a directory:
The following files alll have issues with x-hacks, try to address it
Break the following 15 files into 3 issues editing 5 files each.
./packages/blobs/grub/09_linux_with_dtb.sh ./packages/bsp/nanopim4/nanopim4-pwm-fan.sh ./lib/tools/shellcheck.sh ./lib/functions/artifacts/artifact-armbian-bsp-cli.sh ./lib/functions/artifacts/artifact-firmware.sh ./lib/functions/rootfs/distro-specific.sh ./lib/functions/artifacts/artifacts-obtain.sh ./lib/functions/artifacts/artifacts-reversion.sh ./lib/functions/artifacts/artifact-uboot.sh ./lib/functions/artifacts/artifact-armbian-base-files.sh ./lib/functions/cli/entrypoint.sh ./lib/functions/artifacts/artifact-rootfs.sh ./lib/functions/artifacts/artifact-kernel.sh ./lib/functions/cli/commands.sh ./lib/functions/artifacts/artifact-full_firmware.sh
Checklist: