@@ -192,18 +192,29 @@ if [ -f "${HOME}/.zshrc" ]; then
192
192
shell_config_file=" ${HOME} /.zshrc"
193
193
elif [ -f " ${HOME} /.bashrc" ]; then
194
194
shell_config_file=" ${HOME} /.bashrc"
195
+ elif [ -f " ${HOME} /.config/fish/config.fish" ]; then
196
+ if [ ! -f " ${HOME} /.config/fish/conf.d/gitsign-credential-cache.fish" ]; then
197
+ echo " set -x GITSIGN_CREDENTIAL_CACHE \" ${gitsign_cache_path} \" " > " ${HOME} /.config/fish/conf.d/gitsign-credential-cache.fish"
198
+ echo " Added GITSIGN_CREDENTIAL_CACHE to ${HOME} /.config/fish/conf.d/gitsign-credential-cache.fish. Please restart your shell to apply the changes."
199
+ else
200
+ echo " GITSIGN_CREDENTIAL_CACHE already exists in ${HOME} /.config/fish/conf.d/gitsign-credential-cache.fish!"
201
+ fi
202
+ shell_config_file=" "
195
203
else
196
204
echo " No .bashrc or .zshrc found in your home directory."
197
205
exit 1
198
206
fi
199
207
200
- export_line=" export GITSIGN_CREDENTIAL_CACHE=\" ${gitsign_cache_path} \" "
201
- if ! grep -qF -- " ${export_line} " " ${shell_config_file} " ; then
202
- echo " ${export_line} " >> " ${shell_config_file} "
203
- echo " Added GITSIGN_CREDENTIAL_CACHE to ${shell_config_file} . Please restart your shell to apply the changes: 'source ${shell_config_file} '"
204
- else
205
- echo " GITSIGN_CREDENTIAL_CACHE already exists in ${shell_config_file} !"
208
+ if [ ! -z " ${shell_config_file} " ]; then
209
+ export_line=" export GITSIGN_CREDENTIAL_CACHE=\" ${gitsign_cache_path} \" "
210
+ if ! grep -qF -- " ${export_line} " " ${shell_config_file} " ; then
211
+ echo " ${export_line} " >> " ${shell_config_file} "
212
+ echo " Added GITSIGN_CREDENTIAL_CACHE to ${shell_config_file} . Please restart your shell to apply the changes: 'source ${shell_config_file} '"
213
+ else
214
+ echo " GITSIGN_CREDENTIAL_CACHE already exists in ${shell_config_file} !"
215
+ fi
206
216
fi
217
+
207
218
EOF
208
219
chmod +x /tmp/gitsign-credential-cache.sh
209
220
echo " Running the script to create the launchctl service..."
@@ -221,4 +232,4 @@ and of course if you would like to tail the logs of your service you can do so b
221
232
222
233
``` sh
223
234
tail -f /opt/homebrew/var/log/gitsign-credential-cache.log
224
- ```
235
+ ```
0 commit comments