Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefer tr to ${char^^}, which does not work on older bash versions #303

Merged

Conversation

jjowdy
Copy link
Contributor

@jjowdy jjowdy commented Dec 17, 2023

Advantage 360 Pro PR template

What's changed:

get_version.sh now tries uppercasing first with a method that will generally work with older versions of Bash (provided tr is available on the host, which is almost always true), but falls back to ${char^^} just in case tr fails.

Why has this change been implemented:

Not all users will be on new enough versions of bash that support the ^^ substitution. This is particularly true on Mac, where /bin/bash is usually an older version (especially since Mac adopted zsh as the default shell).

What (if any) actions must a user take after this change:

This should require no changes.

@jjowdy
Copy link
Contributor Author

jjowdy commented Dec 17, 2023

Without this, Mac users in particular are likely to see this error when running make:

bin/get_version.sh: line 12: <&kp ${char^^}>, : bad substitution

@ReFil
Copy link
Collaborator

ReFil commented Dec 18, 2023

Thanks for this PR, Is it alright if i edit it to add the changelog?

@jjowdy
Copy link
Contributor Author

jjowdy commented Dec 18, 2023

Be my guest! Thanks.

@ReFil ReFil merged commit 1728a66 into KinesisCorporation:V3.0 Dec 27, 2023
1 check passed
moritzschatz pushed a commit to moritzschatz/Adv360-Pro-ZMK that referenced this pull request Jan 3, 2024
…inesisCorporation#303)

* Prefer `tr` to ${char^^}, which does not work on older bash versions

* Update CHANGELOG.md

---------

Co-authored-by: ReFil <31960031+ReFil@users.noreply.github.com>
moritzschatz pushed a commit to moritzschatz/Adv360-Pro-ZMK that referenced this pull request Jan 3, 2024
…inesisCorporation#303)

* Prefer `tr` to ${char^^}, which does not work on older bash versions

* Update CHANGELOG.md

---------

Co-authored-by: ReFil <31960031+ReFil@users.noreply.github.com>
gshpychka pushed a commit to gshpychka/Adv360-Pro-ZMK that referenced this pull request Jan 4, 2024
…inesisCorporation#303)

* Prefer `tr` to ${char^^}, which does not work on older bash versions

* Update CHANGELOG.md

---------

Co-authored-by: ReFil <31960031+ReFil@users.noreply.github.com>
KarelSchwab pushed a commit to KarelSchwab/Adv360-Pro-ZMK that referenced this pull request Jan 11, 2024
…inesisCorporation#303)

* Prefer `tr` to ${char^^}, which does not work on older bash versions

* Update CHANGELOG.md

---------

Co-authored-by: ReFil <31960031+ReFil@users.noreply.github.com>
noseworthy pushed a commit to noseworthy/Adv360-Pro-ZMK that referenced this pull request Jan 16, 2024
…inesisCorporation#303)

* Prefer `tr` to ${char^^}, which does not work on older bash versions

* Update CHANGELOG.md

---------

Co-authored-by: ReFil <31960031+ReFil@users.noreply.github.com>
Coobaha added a commit to Coobaha/Adv360-Pro-ZMK that referenced this pull request Jan 17, 2024
# By ReFil (7) and others
# Via GitHub
* upstream/v3.0:
  Update Makefile variables (KinesisCorporation#335)
  Base ZMK update (KinesisCorporation#326)
  Prefer `tr` to ${char^^}, which does not work on older bash versions (KinesisCorporation#303)
  Add version macro (KinesisCorporation#300)
  Add pull request template (KinesisCorporation#293)
  Revert "Updated keymap"
  Revert "Updated keymap"
  Updated keymap
  Updated keymap
  Make get_version use bash from $PATH (KinesisCorporation#287)
  Update bluetooth settings in light of user feedback (KinesisCorporation#289)

# Conflicts:
#	Makefile
mdecamposmendes pushed a commit to mdecamposmendes/Adv360-Pro-ZMK that referenced this pull request Jan 21, 2024
…inesisCorporation#303)

* Prefer `tr` to ${char^^}, which does not work on older bash versions

* Update CHANGELOG.md

---------

Co-authored-by: ReFil <31960031+ReFil@users.noreply.github.com>
alok added a commit to alok/Adv360-Pro-ZMK that referenced this pull request Feb 6, 2024
* upstream/V3.0:
  Makefile enhancements to optimize local workflows (KinesisCorporation#363)
  Update Makefile variables (KinesisCorporation#335)
  Base ZMK update (KinesisCorporation#326)
  Prefer `tr` to ${char^^}, which does not work on older bash versions (KinesisCorporation#303)
  Add version macro (KinesisCorporation#300)
  Add pull request template (KinesisCorporation#293)
  Revert "Updated keymap"
  Revert "Updated keymap"
  Updated keymap
  Updated keymap
  Make get_version use bash from $PATH (KinesisCorporation#287)
sanderdrummer added a commit to sanderdrummer/Adv360-Pro-ZMK that referenced this pull request Feb 8, 2024
* feat: update keymap

* Update bluetooth settings in light of user feedback (KinesisCorporation#289)

* Make get_version use bash from $PATH (KinesisCorporation#287)

* Make get_version use bash from $PATH

* Update CHANGELOG.md

---------

Co-authored-by: ReFil <31960031+ReFil@users.noreply.github.com>

* Updated keymap

* Updated keymap

* Revert "Updated keymap"

This reverts commit 18e664a.

* Revert "Updated keymap"

This reverts commit 9fc6c62.

* Add pull request template (KinesisCorporation#293)

* Add pull request template

* Update CHANGELOG.md

* Add version macro (KinesisCorporation#300)

* Prefer `tr` to ${char^^}, which does not work on older bash versions (KinesisCorporation#303)

* Prefer `tr` to ${char^^}, which does not work on older bash versions

* Update CHANGELOG.md

---------

Co-authored-by: ReFil <31960031+ReFil@users.noreply.github.com>

* Base ZMK update (KinesisCorporation#326)

* Update Makefile variables (KinesisCorporation#335)

* Makefile enhancements to optimize local workflows (KinesisCorporation#363)

- Enhance the Makefile to enable firmware building exclusively for the left side.

To modify the keymap, flashing only the left side's firmware suffices.

This change facilitates the creation of firmware for the left side only,
thereby expediting the build process.

Usage: make left

This update maintains existing functionality. Without specifying the
left target, firmware for both halves will be generated.

- Add separate make targets to clean firmware and docker image

Add targets clean_firmware and clean_image independently while maintaing clean to run both

- Ensure files modified by the build process are reset at the end

The current build process dynamically generates the content of the version macro
in config/version.dtsi to enable users to print out the precise version and commit
the firmware was built on via a keybinding on the keymap.

This change ensurs that the changes to this macro file are reset at the end of the
build process to ensure it isn't shown as modified and added to keymap commit changes.

* feat: add f keys

---------

Co-authored-by: ReFil <31960031+ReFil@users.noreply.github.com>
Co-authored-by: David Whetstone <humblehacker@users.noreply.github.com>
Co-authored-by: adv360proapp[bot] <105741512+adv360proapp[bot]@users.noreply.github.com>
Co-authored-by: Jim Jowdy <jjowdy@gmail.com>
Co-authored-by: Thomas Huber <113915837+huber-th@users.noreply.github.com>
tricktux pushed a commit to tricktux/Adv360-Pro-ZMK that referenced this pull request Feb 10, 2024
…inesisCorporation#303)

* Prefer `tr` to ${char^^}, which does not work on older bash versions

* Update CHANGELOG.md

---------

Co-authored-by: ReFil <31960031+ReFil@users.noreply.github.com>
OAGr added a commit to OAGr/Adv360-Pro-ZMK-v1 that referenced this pull request Mar 2, 2024
* V3.0: (57 commits)
  Fix version.dtsi is reset after local firmware build (KinesisCorporation#385)
  Update build workflows (KinesisCorporation#376)
  Makefile enhancements to optimize local workflows (KinesisCorporation#363)
  Update Makefile variables (KinesisCorporation#335)
  Base ZMK update (KinesisCorporation#326)
  Prefer `tr` to ${char^^}, which does not work on older bash versions (KinesisCorporation#303)
  Add version macro (KinesisCorporation#300)
  Add pull request template (KinesisCorporation#293)
  Revert "Updated keymap"
  Revert "Updated keymap"
  Updated keymap
  Updated keymap
  Make get_version use bash from $PATH (KinesisCorporation#287)
  Update bluetooth settings in light of user feedback (KinesisCorporation#289)
  Revert "Add version macro to keymap.json (KinesisCorporation#269)"
  Add version macro to keymap.json (KinesisCorporation#269)
  Changelog new base ZMK update (KinesisCorporation#268)
  Version compiled FW with automatic macro (KinesisCorporation#267)
  Document new NKRO settings (KinesisCorporation#264)
  Improve documentation based on feedback (KinesisCorporation#260)
  ...
ztomer pushed a commit to ztomer/Adv360-Pro-ZMK that referenced this pull request Apr 16, 2024
…inesisCorporation#303)

* Prefer `tr` to ${char^^}, which does not work on older bash versions

* Update CHANGELOG.md

---------

Co-authored-by: ReFil <31960031+ReFil@users.noreply.github.com>
zemackdaddy pushed a commit to zemackdaddy/Adv360-Pro-ZMK that referenced this pull request Jul 7, 2024
…inesisCorporation#303)

* Prefer `tr` to ${char^^}, which does not work on older bash versions

* Update CHANGELOG.md

---------

Co-authored-by: ReFil <31960031+ReFil@users.noreply.github.com>
jan-l pushed a commit to jan-l/Adv360-Pro-ZMK that referenced this pull request Aug 28, 2024
…inesisCorporation#303)

* Prefer `tr` to ${char^^}, which does not work on older bash versions

* Update CHANGELOG.md

---------

Co-authored-by: ReFil <31960031+ReFil@users.noreply.github.com>
martypenner added a commit to martypenner/Adv360-Pro-ZMK that referenced this pull request Nov 6, 2024
* V3.0: (40 commits)
  Changelog update (KinesisCorporation#448)
  Minor docs update (KinesisCorporation#445)
  Document new layer colors and modifier color configuration option (KinesisCorporation#431)
  Zephyr 3.5 Update (KinesisCorporation#426)
  Fix Makefile errors that prevent builds on macOS (KinesisCorporation#409)
  Fix version.dtsi is reset after local firmware build (KinesisCorporation#385)
  Update build workflows (KinesisCorporation#376)
  Makefile enhancements to optimize local workflows (KinesisCorporation#363)
  Update Makefile variables (KinesisCorporation#335)
  Base ZMK update (KinesisCorporation#326)
  Prefer `tr` to ${char^^}, which does not work on older bash versions (KinesisCorporation#303)
  Add version macro (KinesisCorporation#300)
  Add pull request template (KinesisCorporation#293)
  Revert "Updated keymap"
  Revert "Updated keymap"
  Updated keymap
  Updated keymap
  Make get_version use bash from $PATH (KinesisCorporation#287)
  Update bluetooth settings in light of user feedback (KinesisCorporation#289)
  Revert "Add version macro to keymap.json (KinesisCorporation#269)"
  ...
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.

2 participants