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

Simplify code maintenance #480

Merged
merged 4 commits into from
Oct 24, 2023
Merged

Simplify code maintenance #480

merged 4 commits into from
Oct 24, 2023

Conversation

paulo-ferraz-oliveira
Copy link
Contributor

@paulo-ferraz-oliveira paulo-ferraz-oliveira commented Oct 19, 2023

Description

Eases maintenance by auto-assigning variables declared as strings in _KERL_CFGS.

Closes #194.

kerl Outdated Show resolved Hide resolved
@paulo-ferraz-oliveira
Copy link
Contributor Author

paulo-ferraz-oliveira commented Oct 19, 2023

If you write

echo "$_KERL_TARGET_VAR=\"$_KERL_CFG_VAR\""

just before the last eval on act_on_kerl_cfgs you can see it in action 😄

And to think ShellCheck tried to teach me this so many times :)
I specifically tested this mechanism for KERL_DEPLOY_SSH_OPTIONS with

```
f() {
    echo 1: $1
    echo 2: $2
}
f $KERL_DEPLOY_SSH_OPTIONS
```

by using

```
KERL_DEPLOY_SSH_OPTIONS="opt1 opt2" ./kerl
```

and got

```
1: opt1
2: opt2
```
@@ -281,6 +261,9 @@ KERL_BUILD_DOCS=
KERL_DOC_TARGETS=chunks
KERL_BUILD_BACKEND=
KERL_RELEASE_TARGET=
"
act_on_kerl_cfgs "$_KERL_CFGS" "cache"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Called it here to have the _KERL_CFGS variable defined, but it does (similar to) what's above, from lines 227-268.

@paulo-ferraz-oliveira paulo-ferraz-oliveira merged commit f6aaa94 into kerl:master Oct 24, 2023
9 checks passed
@paulo-ferraz-oliveira paulo-ferraz-oliveira deleted the feature/less-code-via-cache-and-restore branch October 24, 2023 19:45
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.

Replace env var crunching with neat xargs trick
2 participants