Skip to content

Commit 1f3a3e3

Browse files
committed
fix version number for published feature
1 parent c07783f commit 1f3a3e3

File tree

3 files changed

+17
-21
lines changed

3 files changed

+17
-21
lines changed

.devcontainer/features/bash-config/README.md

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,14 @@
22

33
## Defaults
44

5-
When this feature is first called, onCreateCommand.sh is created and called in `devcontainer-feature`.
6-
This creates and installs a default bash terminal configuration from `feature_settings_rc` which contains opinionated default BASH terminal settings such as:
7-
* A minimalist, blue bash prompt.
8-
* Eternal, shared history between containers using this feature.
9-
10-
## Customisation
11-
12-
The user can specify their own terminal preferences in `$CONFIG_STAGING/bashrc`, which defaults to `/devcontainer_staging/bashrc`.
13-
Then the container is rebuilt, if `bashrc` already exists it won't be overwritten, preserving changes. If the container has been built once already, the existing bashrc must be deleted in order for your changes to be applied.
5+
The default, opinionated configuration is defined in
6+
`$HOME/.config/bash-config/bash-config-rc` and includes the following:
147

8+
- Persistent history across all devcontainers that use this feature
9+
- The MS devcontainer bash prompt with git branch and status
10+
- history search with up/down arrows (.inputrc)
11+
- ctrl-left or right arrow for word navigation (.inputrc)
1512

13+
## Customisation
1614

17-
creates staging folder in container
18-
creates onCreateCommand.sh in the staging folder
19-
inputrc and bashrc are also created in the staging folder, containing incremental history searching and user customisations respectively
20-
feature_settings_rc is created in the staging fodler, which contains a PS1 setup and opinionated terminal features
21-
"onCreateCommand" is then exectuted inside the container during finalisation of container setup.
22-
- This copies the contents of feature_settings_rc into devcontainer_rc
23-
- then copies bashrc and inputrc into the container, unless they exist already to prevent overwriting user edits
24-
- then adds root permissions.
25-
A symbolic link to /root/ is created The items in the CONFIG_FOLDER
26-
our bashrc is called by /root/.bashrc
15+
Can be customized by editing `$HOME/.config/bash-config/bashrc`

.devcontainer/features/bash-config/devcontainer-feature.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"name": "Lightweight and configurable BASH eternal history",
33
//ID *must* match parent folder name *exactly*
44
"id": "bash-config",
5-
"version": "test",
5+
// a default beta version that is replaced by CI when doing tagged releases
6+
"version": "0.0.1-b1",
67
"description": "Lightweight BASH setup with eternal history and PS1 tweaks. Fully configurable.",
78
"documentationURL": "https://raw.githubusercontent.com/DiamondRC/devcontainer-features/refs/heads/main/.devcontainer/features/bash-config/README.md",
89
"containerEnv": {

.github/workflows/release.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,14 @@ jobs:
1616
- uses: actions/checkout@v4
1717

1818
- name: patch in version tag
19+
# patch the version tag if the version is a valid semver. If not the
20+
# default to the
1921
run: |
20-
sed -i s/replace-with-version-tag/${{ github.ref_name }}/ $(find .devcontainer -name devcontainer-feature.json)
22+
if [[ ${{ github.ref_name }} =~ ^[0-9]+\.[0-9]+.+ ]] ; then
23+
sed -i s/0\.0\.0-b1/${{ github.ref_name }}/ $(find .devcontainer -name devcontainer-feature.json)
24+
# dump the modified json for debugging
25+
cat $(find .devcontainer -name devcontainer-feature.json)
26+
fi
2127
2228
- name: "Publish Features"
2329
uses: devcontainers/action@v1

0 commit comments

Comments
 (0)