Skip to content

Commit e31ca63

Browse files
committed
make names more consistent
1 parent 0ed28a3 commit e31ca63

File tree

8 files changed

+44
-14
lines changed

8 files changed

+44
-14
lines changed

.devcontainer/devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
],
3535
// Mount the parent as /workspaces so we can pip install peers as editable
3636
"workspaceMount": "source=${localWorkspaceFolder}/..,target=/workspaces,type=bind",
37-
"initializeCommand": "mkdir -p ${localEnv:HOME}/.config/devcontainer_rc",
37+
// Create the config folder for the bash-config feature
38+
"initializeCommand": "mkdir -p ${localEnv:HOME}/.config/bash-config",
3839
"remoteUser": "root"
3940
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# bash-config configuration files
2+
3+
## introduction
4+
5+
The files in this folder are copied out of the bash-config feature and
6+
into the users config folder on the host at ~/.config/bash-config
7+
8+
## files
9+
10+
- bashrc: The entry point for the bash-config feature. User editable
11+
- inputrc: The readline configuration file. User editable
12+
- bash-config-rc: The configuration file for the bash-config feature. Not
13+
user editable. Replaced with the latest version on each rebuild of the
14+
developer container.
15+
16+
## Stages
17+
18+
1. At build time all the files in this folder are copied to a staging folder
19+
in the container filesystem.
20+
1. At container runtime the files are copied from the staging folder to the
21+
users config folder on the host.
22+
1. The file onCreateCommand.sh is executed at container creation time in order
23+
to facilitate the above copy.

.devcontainer/features/bash-config/feature_settings_rc renamed to .devcontainer/features/bash-config/config/bash-config-rc

File renamed without changes.

.devcontainer/features/bash-config/bashrc renamed to .devcontainer/features/bash-config/config/bashrc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77
# This file is initialized by bash-config, but you are then free to edit it
88

99
# execute default, opinionated settings - delete this line to remove defaults
10-
source $CONFIG_FOLDER/feature_settings_rc
10+
source $CONFIG_FOLDER/bash-config-rc
1111

12-
# add your personal custom settings below
12+
if [ ! -f /one-time ]; then
13+
14+
# add your personal one time only (container creation) commands here
15+
16+
touch /one-time
17+
fi
18+
19+
# add your personal settings for every shell below
File renamed without changes.

.devcontainer/features/bash-config/onCreateCommand.sh renamed to .devcontainer/features/bash-config/config/onCreateCommand.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# this script is run once inside the developer container at creation time
44

55
# copy in the opinionated default settings from the feature
6-
cp $CONFIG_STAGING/feature_settings_rc $CONFIG_FOLDER/feature_settings_rc
6+
cp $CONFIG_STAGING/bash-config-rc $CONFIG_FOLDER
77

88
# copy in the user editable settings unless they already exist
99
if [[ ! -f $CONFIG_FOLDER/bashrc ]] ; then

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
"description": "Lightweight BASH setup with eternal history and PS1 tweaks. Fully configurable.",
88
"documentationURL": "https://raw.githubusercontent.com/DiamondRC/devcontainer-features/refs/heads/main/.devcontainer/features/bash-config/README.md",
99
"containerEnv": {
10-
"CONFIG_FOLDER": "/devcontainer_rc",
11-
"CONFIG_STAGING": "/devcontainer_staging"
10+
"CONFIG_FOLDER": "/bash-config",
11+
"CONFIG_STAGING": "/bash-config-staging"
1212
},
1313
"mounts": [
1414
{
15-
"source": "${localEnv:HOME}/.config/devcontainer_rc",
16-
"target": "/devcontainer_rc",
15+
"source": "${localEnv:HOME}/.config/bash-config",
16+
"target": "/bash-config",
1717
"type": "bind"
1818
}
1919
],
20-
"onCreateCommand": "bash /devcontainer_staging/onCreateCommand.sh"
20+
"onCreateCommand": "bash /bash-config-staging/onCreateCommand.sh"
2121
}

.devcontainer/features/bash-config/install.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
# abort on error
44
set -e
55

6-
# discover where the install.sh and peers have been extracted to
6+
# discover where this install.sh and its peers have been extracted to
77
this_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
88

99

10-
echo "Activating feature 'terminal-history'"
10+
echo "Activating feature 'bash-config'"
1111
echo "User: ${_REMOTE_USER} User home: ${_REMOTE_USER_HOME}"
1212

1313
# This script is run at container build time.
@@ -17,9 +17,8 @@ echo "User: ${_REMOTE_USER} User home: ${_REMOTE_USER_HOME}"
1717
# Then at container runtime, when the hosts' config folder is mounted in, we
1818
# can copy from the staging area to the mounted host folder
1919
#
20-
# The runtime copy to host folder is performed once oby onCreateCommand.sh
20+
# The runtime copy to host folder is performed once only by onCreateCommand.sh
2121

2222
mkdir -p "$CONFIG_STAGING"
23-
cp -r "$this_dir"/* "$CONFIG_STAGING"
24-
echo $this_dir > "$CONFIG_STAGING/this_dir"
23+
cp -r "$this_dir"/config/* "$CONFIG_STAGING"
2524

0 commit comments

Comments
 (0)