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

Make get_version use bash from $PATH #287

Merged
merged 3 commits into from
Dec 7, 2023

Conversation

humblehacker
Copy link
Contributor

When I try the local containerized build and I get to the make step, the following dumps to the console before the build proceeds:

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

The ${char^^} syntax requires bash 4 or greater. Unfortunately, Apple hasn't updated bash (and many other unix tools) in a long time:

> /bin/bash --version
GNU bash, version 3.2.57(1)-release (arm64-apple-darwin23)
Copyright (C) 2007 Free Software Foundation, Inc.

I've updated bash on my system via homebrew, but this script doesn't find it because it hardcodes the path in the hashbang comment.

This change uses env to make the script pull bash from $PATH rather than assuming its location.

@ReFil
Copy link
Collaborator

ReFil commented Dec 6, 2023

Thank you for this PR, it's very much appreciated. Would it be alright if i edited the PR to add this change to teh changelog?

@humblehacker
Copy link
Contributor Author

Of course, feel free to change anything.

@ReFil ReFil merged commit 1193212 into KinesisCorporation:V3.0 Dec 7, 2023
1 check passed
fred-drake pushed a commit to fred-drake/Adv360-Keyboard that referenced this pull request Dec 17, 2023
* Make get_version use bash from $PATH

* 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
* Make get_version use bash from $PATH

* 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
* Make get_version use bash from $PATH

* 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
* Make get_version use bash from $PATH

* 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
* Make get_version use bash from $PATH

* 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
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
* Make get_version use bash from $PATH

* 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
* Make get_version use bash from $PATH

* 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
* Make get_version use bash from $PATH

* 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
* Make get_version use bash from $PATH

* Update CHANGELOG.md

---------

Co-authored-by: ReFil <31960031+ReFil@users.noreply.github.com>
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