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

Actually set 'husky_skip_init' as readonly in ./husky.sh #1104

Merged
merged 1 commit into from Feb 20, 2022
Merged

Actually set 'husky_skip_init' as readonly in ./husky.sh #1104

merged 1 commit into from Feb 20, 2022

Conversation

hyperupcall
Copy link
Contributor

@hyperupcall hyperupcall commented Feb 16, 2022

Previously, the husky.sh script would export the empty 'readonly' variable, along with 'husky_skip_init' which has a value of 1.

Now, the script sets 'husky_skip_init' to 1, and properly gives is the 'readonly' and 'exported' attributes.

Previously, the script would export the empty 'readonly' variable, along
with 'husky_skip_init' which has a value of 1. Now, the script sets
'husky_skip_init' to 1, and properly gives is the readonly and exported
attributes.
@typicode
Copy link
Owner

@typicode typicode commented Feb 17, 2022

I may be missing something but I can't seem to reproduce the issue. I tried in bash:

~ 
❯ export readonly husky_skip_init=1

~ 
❯ echo $husky_skip_init
1

@hyperupcall
Copy link
Contributor Author

@hyperupcall hyperupcall commented Feb 17, 2022

Hai,

In both cases, the value of husky_skip_init is 1, the difference is whether the variable is marked as readonly

Before the changes, a variable called readonly was spuriously created

$ export readonly husky_skip_init=1

$ declare -p readonly
declare -x readonly

$ declare -p husky_skip_init
declare -x husky_skip_init="1"

In other words, not readonly

$ export readonly husky_skip_init=1
$ husky_skip_init=2
$ # (no error)

It didn't seem to match up semantically, as in other cases variables were properly marked as readonly

So I changed the code so that husky_skip_init was actually readonly, since it seemed like that was the original intent. After the changes, we get

$ readonly husky_skip_init=1
$ export husky_skip_init

$ declare -p readonly
bash: declare: readonly: not found

$ declare -p husky_skip_init
declare -rx husky_skip_init="1"

As you can see, as a result, the husky_skip_init variable is marked as readonly (-r) and a variable called 'readonly' isn't spuriously created

$ readonly husky_skip_init=1
$ export husky_skip_init
$ husky_skip_init=2
bash: husky_skip_init: readonly variable

It doesn't make a huge difference in terms of behavior since the variable isn't used much or modified, but I'm sure for people not (or less) familiar with shell, the code is less confusing

@typicode
Copy link
Owner

@typicode typicode commented Feb 20, 2022

I see, good catch 👍
Thanks for the very detailed steps.

@typicode typicode merged commit 82b0c59 into typicode:main Feb 20, 2022
kodiakhq bot pushed a commit to ToppleTheNun/npm-lockfile-version that referenced this issue May 8, 2022
[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [husky](https://typicode.github.io/husky) ([source](https://togithub.com/typicode/husky)) | [`7.0.4` -> `8.0.0`](https://renovatebot.com/diffs/npm/husky/7.0.4/8.0.0) | [![age](https://badges.renovateapi.com/packages/npm/husky/8.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/husky/8.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/husky/8.0.0/compatibility-slim/7.0.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/husky/8.0.0/confidence-slim/7.0.4)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>typicode/husky</summary>

### [`v8.0.0`](https://togithub.com/typicode/husky/releases/v8.0.0)

[Compare Source](https://togithub.com/typicode/husky/compare/v7.0.4...v8.0.0)

#### What's Changed

##### Feats

-   feat: add `husky -` prefix to logged global error messages by [@&#8203;joshbalfour](https://togithub.com/joshbalfour) in [typicode/husky#1092
-   feat: show `PATH` when command not found to improve debuggability
-   feat: drop Node 12 support
-   feat: skip install if `$HUSKY=0`

##### Fixes

-   fix: hook script use `/usr/bin/env sh` instead of direct path of `sh` by [@&#8203;skhaz](https://togithub.com/skhaz) in [typicode/husky#1051
-   fix: actually set 'husky_skip_init' as readonly in `./husky.sh` by [@&#8203;hyperupcall](https://togithub.com/hyperupcall) in [typicode/husky#1104
-   fix: force `basename`/`dirname` to treat `$0` as an argument by [@&#8203;mataha](https://togithub.com/mataha) in [typicode/husky#1132
-   fix: remove `git.io` links by [@&#8203;renbaoshuo](https://togithub.com/renbaoshuo) in [typicode/husky#1136

##### Docs

-   docs: fix uninstall via npm by [@&#8203;pddpd](https://togithub.com/pddpd) in [typicode/husky#1033
-   docs: add dog emoji as favicon by [@&#8203;jamiehaywood](https://togithub.com/jamiehaywood) in [typicode/husky#1095
-   docs: replace deprecated `npx --no-install` option with `npx --no` by [@&#8203;sibiraj-s](https://togithub.com/sibiraj-s) in [typicode/husky#1070
-   docs: add `pnpm` installation by [@&#8203;MohamadKh75](https://togithub.com/MohamadKh75) in [typicode/husky#1139

##### Chore

-   chore: update workflows by [@&#8203;tiziodcaio](https://togithub.com/tiziodcaio) in [typicode/husky#1125

</details>

---

### Configuration

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

 **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/ToppleTheNun/npm-lockfile-version).
hoonoh pushed a commit to hoonoh/aws-spot-price that referenced this issue May 9, 2022
[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [husky](https://typicode.github.io/husky) ([source](https://togithub.com/typicode/husky)) | [`7.0.4` -> `8.0.0`](https://renovatebot.com/diffs/npm/husky/7.0.4/8.0.0) | [![age](https://badges.renovateapi.com/packages/npm/husky/8.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/husky/8.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/husky/8.0.0/compatibility-slim/7.0.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/husky/8.0.0/confidence-slim/7.0.4)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>typicode/husky</summary>

### [`v8.0.0`](https://togithub.com/typicode/husky/releases/v8.0.0)

[Compare Source](https://togithub.com/typicode/husky/compare/v7.0.4...v8.0.0)

#### What's Changed

##### Feats

-   feat: add `husky -` prefix to logged global error messages by [@&#8203;joshbalfour](https://togithub.com/joshbalfour) in [typicode/husky#1092
-   feat: show `PATH` when command not found to improve debuggability
-   feat: drop Node 12 support
-   feat: skip install if `$HUSKY=0`

##### Fixes

-   fix: hook script use `/usr/bin/env sh` instead of direct path of `sh` by [@&#8203;skhaz](https://togithub.com/skhaz) in [typicode/husky#1051
-   fix: actually set 'husky_skip_init' as readonly in `./husky.sh` by [@&#8203;hyperupcall](https://togithub.com/hyperupcall) in [typicode/husky#1104
-   fix: force `basename`/`dirname` to treat `$0` as an argument by [@&#8203;mataha](https://togithub.com/mataha) in [typicode/husky#1132
-   fix: remove `git.io` links by [@&#8203;renbaoshuo](https://togithub.com/renbaoshuo) in [typicode/husky#1136

##### Docs

-   docs: fix uninstall via npm by [@&#8203;pddpd](https://togithub.com/pddpd) in [typicode/husky#1033
-   docs: add dog emoji as favicon by [@&#8203;jamiehaywood](https://togithub.com/jamiehaywood) in [typicode/husky#1095
-   docs: replace deprecated `npx --no-install` option with `npx --no` by [@&#8203;sibiraj-s](https://togithub.com/sibiraj-s) in [typicode/husky#1070
-   docs: add `pnpm` installation by [@&#8203;MohamadKh75](https://togithub.com/MohamadKh75) in [typicode/husky#1139

##### Chore

-   chore: update workflows by [@&#8203;tiziodcaio](https://togithub.com/tiziodcaio) in [typicode/husky#1125

</details>

---

### Configuration

📅 **Schedule**: "after 5pm on Friday,every weekend" (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

 **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/hoonoh/aws-spot-price).

Co-authored-by: Renovate Bot <bot@renovateapp.com>
kodiakhq bot pushed a commit to mheob/vscode-snippets that referenced this issue May 14, 2022
[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [husky](https://typicode.github.io/husky) ([source](https://togithub.com/typicode/husky)) | [`^7.0.4` -> `^8.0.0`](https://renovatebot.com/diffs/npm/husky/7.0.4/8.0.1) | [![age](https://badges.renovateapi.com/packages/npm/husky/8.0.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/husky/8.0.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/husky/8.0.1/compatibility-slim/7.0.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/husky/8.0.1/confidence-slim/7.0.4)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>typicode/husky</summary>

### [`v8.0.1`](https://togithub.com/typicode/husky/releases/v8.0.1)

[Compare Source](https://togithub.com/typicode/husky/compare/v8.0.0...v8.0.1)

-   fix: use POSIX equality operator

### [`v8.0.0`](https://togithub.com/typicode/husky/releases/v8.0.0)

[Compare Source](https://togithub.com/typicode/husky/compare/v7.0.4...v8.0.0)

#### What's Changed

##### Feats

-   feat: add `husky -` prefix to logged global error messages by [@&#8203;joshbalfour](https://togithub.com/joshbalfour) in [typicode/husky#1092
-   feat: show `PATH` when command not found to improve debuggability
-   feat: drop Node 12 support
-   feat: skip install if `$HUSKY=0`

##### Fixes

-   fix: hook script use `/usr/bin/env sh` instead of direct path of `sh` by [@&#8203;skhaz](https://togithub.com/skhaz) in [typicode/husky#1051
-   fix: actually set 'husky_skip_init' as readonly in `./husky.sh` by [@&#8203;hyperupcall](https://togithub.com/hyperupcall) in [typicode/husky#1104
-   fix: force `basename`/`dirname` to treat `$0` as an argument by [@&#8203;mataha](https://togithub.com/mataha) in [typicode/husky#1132
-   fix: remove `git.io` links by [@&#8203;renbaoshuo](https://togithub.com/renbaoshuo) in [typicode/husky#1136

##### Docs

-   docs: fix uninstall via npm by [@&#8203;pddpd](https://togithub.com/pddpd) in [typicode/husky#1033
-   docs: add dog emoji as favicon by [@&#8203;jamiehaywood](https://togithub.com/jamiehaywood) in [typicode/husky#1095
-   docs: replace deprecated `npx --no-install` option with `npx --no` by [@&#8203;sibiraj-s](https://togithub.com/sibiraj-s) in [typicode/husky#1070
-   docs: add `pnpm` installation by [@&#8203;MohamadKh75](https://togithub.com/MohamadKh75) in [typicode/husky#1139

##### Chore

-   chore: update workflows by [@&#8203;tiziodcaio](https://togithub.com/tiziodcaio) in [typicode/husky#1125

</details>

---

### Configuration

📅 **Schedule**: "before 3am on Friday" (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

 **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/mheob/vscode-snippets).
aviator-app bot pushed a commit to airplanedev/node-sdk that referenced this issue Jun 24, 2022
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [husky](https://typicode.github.io/husky) ([source](https://togithub.com/typicode/husky)) | [`7.0.4` -> `8.0.1`](https://renovatebot.com/diffs/npm/husky/7.0.4/8.0.1) | [![age](https://badges.renovateapi.com/packages/npm/husky/8.0.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/husky/8.0.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/husky/8.0.1/compatibility-slim/7.0.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/husky/8.0.1/confidence-slim/7.0.4)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>typicode/husky</summary>

### [`v8.0.1`](https://togithub.com/typicode/husky/releases/tag/v8.0.1)

[Compare Source](https://togithub.com/typicode/husky/compare/v8.0.0...v8.0.1)

-   fix: use POSIX equality operator

### [`v8.0.0`](https://togithub.com/typicode/husky/releases/tag/v8.0.0)

[Compare Source](https://togithub.com/typicode/husky/compare/v7.0.4...v8.0.0)

#### What's Changed

##### Feats

-   feat: add `husky -` prefix to logged global error messages by [@&#8203;joshbalfour](https://togithub.com/joshbalfour) in [typicode/husky#1092
-   feat: show `PATH` when command not found to improve debuggability
-   feat: drop Node 12 support
-   feat: skip install if `$HUSKY=0`

##### Fixes

-   fix: hook script use `/usr/bin/env sh` instead of direct path of `sh` by [@&#8203;skhaz](https://togithub.com/skhaz) in [typicode/husky#1051
-   fix: actually set 'husky_skip_init' as readonly in `./husky.sh` by [@&#8203;hyperupcall](https://togithub.com/hyperupcall) in [typicode/husky#1104
-   fix: force `basename`/`dirname` to treat `$0` as an argument by [@&#8203;mataha](https://togithub.com/mataha) in [typicode/husky#1132
-   fix: remove `git.io` links by [@&#8203;renbaoshuo](https://togithub.com/renbaoshuo) in [typicode/husky#1136

##### Docs

-   docs: fix uninstall via npm by [@&#8203;pddpd](https://togithub.com/pddpd) in [typicode/husky#1033
-   docs: add dog emoji as favicon by [@&#8203;jamiehaywood](https://togithub.com/jamiehaywood) in [typicode/husky#1095
-   docs: replace deprecated `npx --no-install` option with `npx --no` by [@&#8203;sibiraj-s](https://togithub.com/sibiraj-s) in [typicode/husky#1070
-   docs: add `pnpm` installation by [@&#8203;MohamadKh75](https://togithub.com/MohamadKh75) in [typicode/husky#1139

##### Chore

-   chore: update workflows by [@&#8203;tiziodcaio](https://togithub.com/tiziodcaio) in [typicode/husky#1125

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 5am on Thursday" in timezone America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

 **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.
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.

None yet

2 participants