Skip to content

Conversation

@Nuclear-Squid
Copy link
Contributor

No description provided.

Copy link
Contributor

@AkiroPhi AkiroPhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just checked the code shortly, i neither read the code entirely neither try it to run for now

echo " # -b: build the newly created keymap (after you edited the config)"
echo " # -f: build the newly created keymap (after you edited the config) then flash"
echo " # -c: compile the newly created keymap (after you edited the config)"
echo " # -f: compile the newly created keymap (after you edited the config) then flash"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be you can do something like
-f: flash the newly created keymap and compile it (if needed ?) after you edited the config
At first reading, we can misunderstand the use of -f and precise flash after -f is more clear according to me

Comment on lines +89 to +105
"Recompile and flash keymap with the QMK CLI")
cd "$QMK_PATH"
make "$keyboard_name":arsenik:flash
return 1
;;
"Recompile and flash keymap with \`make\`")
qmk flash -kb $keyboard_name -km arsenik
return 1
;;
"Abort")
echo "Aborting."
return 1
;;
*)
echo "Unknown command chosen. Aborting."
return 1
;;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be the return code used ? If so why returning 1when aborting, and doing make, and doing qmk flash ?
Is it possible to return the code of previous command ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I wanted the function to be able to tell if we should still reinstall the keymap after this case statement (see this comment), but it’s kinda dumb. If you have a better idea to return a status from this function, I’m all ears.

Comment on lines +119 to +120
[ -d "$arsenik_folder" ] && handle_keymap_conflict "$arsenik_folder"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return code of handle_keymap_conflict is not used.
Is it ok ? commit seems to prevent rerun but aborting don’t abort the execution ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is but in a pretty roundabout way. Basically, the set -euo pipefail at the start of the file makes the whole script exit with an error if one command returns an error. So if the exit code from handle_keymap_conflict is not 0, then the script will exit out (and thus, not reinstall the keymap).

I thought it was a bit dirty but maybe fine ? But if you don’t get it then it’s not clear enough and should be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants