-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from gianluca-mascolo/snippets
Implement a layer system using snippets script
- Loading branch information
Showing
21 changed files
with
237 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
README.md.backup | ||
./tests/profiles/ephemeral.load | ||
./tests/profiles/ephemeral.profile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# shellcheck shell=bash | ||
SNIPPET_NAME="$(basename "${BASH_SOURCE[0]}" .sh)" | ||
case "$1" in | ||
load) | ||
_snippet search "$SNIPPET_NAME" && return 0 | ||
# load your settings here >>> | ||
export var1="test1 variable" | ||
# <<< | ||
_snippet push "$SNIPPET_NAME" 2>/dev/null | ||
;; | ||
unload) | ||
_snippet search "$SNIPPET_NAME" || return 0 | ||
# unload your settings here >>> | ||
unset var1 | ||
# <<< | ||
_snippet pop "$SNIPPET_NAME" 2>/dev/null | ||
;; | ||
*) | ||
true | ||
;; | ||
esac | ||
|
||
return 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# shellcheck shell=bash | ||
SNIPPET_NAME="varcommon" | ||
case "$1" in | ||
load) | ||
export check_var_common="${common_value:-}" | ||
_snippet push "$SNIPPET_NAME" 2>/dev/null | ||
;; | ||
unload) | ||
unset check_var_common | ||
_snippet pop "$SNIPPET_NAME" 2>/dev/null | ||
;; | ||
*) | ||
true | ||
;; | ||
esac | ||
|
||
return 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# shellcheck shell=bash | ||
SNIPPET_NAME="$(basename "${BASH_SOURCE[0]}" .sh)" | ||
case "$1" in | ||
load) | ||
export check_var_test1="test1 variable" | ||
export common_value="test1 common" | ||
_snippet push "$SNIPPET_NAME" 2>/dev/null | ||
;; | ||
unload) | ||
unset check_var_test1 | ||
unset common_value | ||
_snippet pop "$SNIPPET_NAME" 2>/dev/null | ||
;; | ||
*) | ||
true | ||
;; | ||
esac | ||
|
||
return 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# shellcheck shell=bash | ||
SNIPPET_NAME="$(basename "${BASH_SOURCE[0]}" .sh)" | ||
case "$1" in | ||
load) | ||
export check_var_test2="test2 variable" | ||
export common_value="test2 common" | ||
_snippet push "$SNIPPET_NAME" 2>/dev/null | ||
;; | ||
unload) | ||
unset check_var_test2 | ||
unset common_value | ||
_snippet pop "$SNIPPET_NAME" 2>/dev/null | ||
;; | ||
*) | ||
true | ||
;; | ||
esac | ||
|
||
return 0 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# comment and spaces will be stripped | ||
# out while parsing the configuration | ||
|
||
vartest1 | ||
varcommon # also if you comment the single snippet name |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
vartest2 | ||
varcommon |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.