Skip to content

Commit a8271b9

Browse files
authored
Write rcrc from install script (#17)
Going around in circles but it does seem like this is a better place for it than living in the dotfiles themselves.
1 parent 31fdf57 commit a8271b9

4 files changed

Lines changed: 13 additions & 4 deletions

File tree

src/personal-setup/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Sets up my desired software and configuration for any devcontainer environment.
77

88
```json
99
"features": {
10-
"ghcr.io/csutter/devcontainer-features/personal-setup:4": {}
10+
"ghcr.io/csutter/devcontainer-features/personal-setup:5": {}
1111
}
1212
```
1313

src/personal-setup/devcontainer-feature.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "personal-setup",
3-
"version": "4.2.0",
3+
"version": "5.0.0",
44
"name": "Personal Setup",
55
"description": "Sets up my desired software and configuration for any devcontainer environment.",
66
"mounts": [
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"containerEnv": {
19-
"RCRC": "/mnt/dotfiles/tag-devcontainer/rcrc",
19+
2020
"PROMPT_PREFIX": "", // Nerd font "remote" icon
2121
"_IS_DEVCONTAINER": "true"
2222
},

src/personal-setup/install.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,10 @@ case "$ID" in
2323
exit 1
2424
;;
2525
esac
26+
27+
echo "Setting up rcm configuration for user: $_REMOTE_USER"
28+
cat > "$_REMOTE_USER_HOME/.rcrc" <<'EOF'
29+
EXCLUDES="README.md"
30+
DOTFILES_DIRS="/mnt/dotfiles /mnt/dotfiles-private"
31+
TAGS="devcontainer"
32+
EOF

test/personal-setup/test.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ check "ssh is available" bash -c "which ssh"
1616
check "tree is available" bash -c "which tree"
1717

1818
# Check dotfiles are installed
19-
check "dotfiles are installed" bash -c "test -f $HOME/.rcrc"
19+
# WARNING: implicit dependency on the contents of the dotfiles repo
20+
check "rcrc is created" bash -c "test -f $HOME/.rcrc"
21+
check "dotfiles are linked" bash -c "test -L $HOME/.config/git/config_devcontainer"
2022

2123
# Check environment variables are set
2224
check "_IS_DEVCONTAINER is set" bash -c "test \"\$_IS_DEVCONTAINER\" = \"true\""

0 commit comments

Comments
 (0)