From 012b0ef354a3761843b6a96b7ada14054914b513 Mon Sep 17 00:00:00 2001 From: Tom Cobb Date: Fri, 20 Dec 2024 15:17:47 +0000 Subject: [PATCH] Install man in the background Also change staging area to /tmp/bash-config and add a do not modify note --- .devcontainer/features/bash-config/config/bash-config-rc | 2 ++ .../features/bash-config/config/postCreateCommand.sh | 6 ++++++ .../features/bash-config/devcontainer-feature.json | 5 +++-- test/bash-config/test.sh | 1 + 4 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 .devcontainer/features/bash-config/config/postCreateCommand.sh diff --git a/.devcontainer/features/bash-config/config/bash-config-rc b/.devcontainer/features/bash-config/config/bash-config-rc index 5e3f78a..8cfe89e 100644 --- a/.devcontainer/features/bash-config/config/bash-config-rc +++ b/.devcontainer/features/bash-config/config/bash-config-rc @@ -1,6 +1,8 @@ #!/bin/bash # default opinioned bash configuration +# DO NOT MODIFY if installed in /bash-config +# this file will be overwritten on each container launch # enable enternal shared history export HISTCONTROL=ignoreboth:erasedups diff --git a/.devcontainer/features/bash-config/config/postCreateCommand.sh b/.devcontainer/features/bash-config/config/postCreateCommand.sh new file mode 100644 index 0000000..ca3ec70 --- /dev/null +++ b/.devcontainer/features/bash-config/config/postCreateCommand.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +# this script is run once inside the developer container after creation time + +# Install man so we can do git --help +apt-get update && apt-get install -y --no-install-recommends man diff --git a/.devcontainer/features/bash-config/devcontainer-feature.json b/.devcontainer/features/bash-config/devcontainer-feature.json index dcd52bb..a7cf5e3 100644 --- a/.devcontainer/features/bash-config/devcontainer-feature.json +++ b/.devcontainer/features/bash-config/devcontainer-feature.json @@ -8,7 +8,7 @@ "documentationURL": "https://raw.githubusercontent.com/DiamondLightSource/devcontainer-features/refs/heads/main/.devcontainer/features/bash-config/README.md", "containerEnv": { "CONFIG_FOLDER": "/bash-config", - "CONFIG_STAGING": "/bash-config-staging" + "CONFIG_STAGING": "/tmp/bash-config" }, "mounts": [ { @@ -17,5 +17,6 @@ "type": "bind" } ], - "onCreateCommand": "bash /bash-config-staging/onCreateCommand.sh" + "onCreateCommand": "bash /tmp/bash-config/onCreateCommand.sh", + "postCreateCommand": "bash /tmp/bash-config/postCreateCommand.sh" } \ No newline at end of file diff --git a/test/bash-config/test.sh b/test/bash-config/test.sh index 2886eb3..c539396 100644 --- a/test/bash-config/test.sh +++ b/test/bash-config/test.sh @@ -11,6 +11,7 @@ source dev-container-features-test-lib # The 'check' command comes from the dev-container-features-test-lib. Syntax is... # check