mirror of
https://github.com/hassio-addons/addon-vscode.git
synced 2025-05-03 18:51:23 +00:00
🔧 Move global gitconfig to persistent
This commit is contained in:
parent
37c837515a
commit
1cce665932
1 changed files with 17 additions and 0 deletions
17
vscode/rootfs/etc/cont-init.d/51-git-config.sh
Normal file
17
vscode/rootfs/etc/cont-init.d/51-git-config.sh
Normal file
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/with-contenv bashio
|
||||
# ==============================================================================
|
||||
# Community Hass.io Add-ons: Visual Studio Code
|
||||
# Sets up the users git global config to be persistent
|
||||
# ==============================================================================
|
||||
readonly GIT_USER_PATH=/data/git
|
||||
|
||||
if ! bashio::fs.directory_exists "${GIT_USER_PATH}"; then
|
||||
mkdir -p "${GIT_USER_PATH}" \
|
||||
|| bashio::exit.nok 'Failed to create a persistent git folder'
|
||||
|
||||
chmod 700 "${GIT_USER_PATH}" \
|
||||
|| bashio::exit.nok \
|
||||
'Failed setting permissions on persistent git folder'
|
||||
fi
|
||||
|
||||
ln -s "${GIT_USER_PATH}/.gitconfig" ~/.gitconfig
|
Loading…
Add table
Add a link
Reference in a new issue