-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update insomnia installation script
- Loading branch information
1 parent
690a829
commit eaa08e9
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,3 +27,38 @@ main_brew() { | |
main() { | ||
return 0 | ||
} | ||
|
||
main_parham() { | ||
mkdir -p "$HOME/.config/Insomnia/" || true | ||
|
||
if [ -d "$HOME/.config/Insomnia/version_control" ]; then | ||
cd "$HOME/.config/Insomnia/version_control" || return | ||
|
||
url=$(git remote get-url origin 2>/dev/null) | ||
if [[ "$url" =~ .*github.com[:/]1995parham-me/insomnia ]]; then | ||
msg 'valid repository, so fetching it' | ||
git pull origin main | ||
|
||
return 0 | ||
else | ||
msg "invalid repository $url" | ||
|
||
if yes_or_no "insomnia" "do you want to remove current insomnia configuration?"; then | ||
msg 'removing current configuration to replace it with new configuration' | ||
rm -Rf "$HOME/.config/Insomnia/version_control" | ||
else | ||
return 1 | ||
fi | ||
fi | ||
fi | ||
|
||
if [ -e "$HOME/.config/Insomnia/version_control" ] || [ -L "$HOME/.config/Insomnia/version_control" ]; then | ||
if yes_or_no "insomnia" "do you want to remove current insomnia configuration?"; then | ||
msg 'removing current configuration to replace it with new configuration' | ||
rm -Rf "$HOME/.config/Insomnia/version_control" | ||
else | ||
return 1 | ||
fi | ||
fi | ||
git clone [email protected]:1995parham-me/insomnia "$HOME/.config/Insomnia/version_control" | ||
} |