mirror of
https://github.com/hassio-addons/addon-vscode.git
synced 2025-05-07 04:31:24 +00:00
✨ Persist user's ZSH history across restarts
This commit is contained in:
parent
a1bbf10f65
commit
3eb4c16a69
1 changed files with 13 additions and 0 deletions
|
@ -5,6 +5,8 @@
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
readonly GIT_USER_PATH=/data/git
|
readonly GIT_USER_PATH=/data/git
|
||||||
readonly SSH_USER_PATH=/data/.ssh
|
readonly SSH_USER_PATH=/data/.ssh
|
||||||
|
readonly ZSH_HISTORY_FILE=/root/.zsh_history
|
||||||
|
readonly ZSH_HISTORY_PERSISTANT_FILE=/data/.zsh_history
|
||||||
|
|
||||||
# Store SSH settings in add-on data folder
|
# Store SSH settings in add-on data folder
|
||||||
if ! bashio::fs.directory_exists "${SSH_USER_PATH}"; then
|
if ! bashio::fs.directory_exists "${SSH_USER_PATH}"; then
|
||||||
|
@ -17,6 +19,17 @@ if ! bashio::fs.directory_exists "${SSH_USER_PATH}"; then
|
||||||
fi
|
fi
|
||||||
ln -s "${SSH_USER_PATH}" ~/.ssh
|
ln -s "${SSH_USER_PATH}" ~/.ssh
|
||||||
|
|
||||||
|
# Sets up ZSH shell
|
||||||
|
touch "${ZSH_HISTORY_PERSISTANT_FILE}" \
|
||||||
|
|| bashio::exit.nok 'Failed creating a persistent ZSH history file'
|
||||||
|
|
||||||
|
chmod 600 "$ZSH_HISTORY_PERSISTANT_FILE" \
|
||||||
|
|| bashio::exit.nok \
|
||||||
|
'Failed setting the correct permissions to the ZSH history file'
|
||||||
|
|
||||||
|
ln -s -f "$ZSH_HISTORY_PERSISTANT_FILE" "$ZSH_HISTORY_FILE" \
|
||||||
|
|| bashio::exit.nok 'Failed linking the persistant ZSH history file'
|
||||||
|
|
||||||
# Store user GIT settings in add-on data folder
|
# Store user GIT settings in add-on data folder
|
||||||
if ! bashio::fs.directory_exists "${GIT_USER_PATH}"; then
|
if ! bashio::fs.directory_exists "${GIT_USER_PATH}"; then
|
||||||
mkdir -p "${GIT_USER_PATH}" \
|
mkdir -p "${GIT_USER_PATH}" \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue