Skip to content

Commit

Permalink
few changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gauravsaini04 committed Nov 14, 2024
1 parent be92e63 commit dec0296
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
9 changes: 1 addition & 8 deletions src/common-utils/devcontainer-feature.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,11 @@
"description": "Preserve shell history across dev container instances? (Currently supports bash, zsh, and fish)"
}
},
"initializeCommand": "chmod -R 755 ${containerWorkspaceFolder}/.devcontainer/common-utils/scripts",
"postCreateCommand": "ls -la ${containerWorkspaceFolder}/.devcontainer/common-utils && ls -la ${containerWorkspaceFolder}/.devcontainer/common-utils/scripts && export DEVCONTAINER_ID=${devcontainerId} && chmod +x /tmp/setup_history.sh && . /tmp/setup_history.sh",
"postCreateCommand": "export DEVCONTAINER_ID=${devcontainerId} && . /tmp/setup_history.sh",
"mounts": [{
"source": "devcontainers",
"target": "/devcontainers",
"type": "volume"
}
,
{
"source": "${containerWorkspaceFolder}/.devcontainer/common-utils/scripts/setup_history.sh",
"target": "/tmp/setup_history.sh",
"type": "bind"
}
]
}
5 changes: 4 additions & 1 deletion src/common-utils/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,10 @@ echo export ALLOW_SHELL_HISTORY="${ALLOW_SHELL_HISTORY}" > /tmp/env.sh
echo export user_home="${user_home}" >> /tmp/env.sh
echo export USERNAME="${USERNAME}" >> /tmp/env.sh

sudo chmod +x /tmp/env.sh
chmod +x /tmp/env.sh

cp -f "${FEATURE_DIR}/scripts/setup_history.sh" /tmp/setup_history.sh
chmod +x /tmp/setup_history.sh

# *********************************
# ** Ensure config directory **
Expand Down
2 changes: 2 additions & 0 deletions src/common-utils/scripts/setup_history.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -e

# Source the environment variables from env.sh
if [ -f /tmp/env.sh ]; then
. /tmp/env.sh
Expand Down
3 changes: 2 additions & 1 deletion test/common-utils/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@
"allowShellHistory": true
}
},
"remoteUser": "vscode"
"remoteUser": "vscode",
"containerUser": "vscode"
}
}

0 comments on commit dec0296

Please sign in to comment.