-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tools): move station installation from brew to shell script
- Loading branch information
Showing
5 changed files
with
100 additions
and
3 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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/usr/bin/env bash | ||
|
||
# dotfiles folder | ||
DOTFILES_FOLDER="$(pwd | grep -o '.*dotfiles')" | ||
|
||
## Variables definitions | ||
|
||
# Tool name | ||
TOOL_NAME=station | ||
|
||
# Tool extra information | ||
EXTRA_INFO="https://github.com/getstation/desktop-app/releases/download/v2.0.9/Station.dmg" | ||
|
||
# Install methods by OS | ||
OS_METHODS="darwin:dmg" | ||
|
||
## Pre-installation required steps | ||
preInstall() { | ||
info "Pre Install for $1" | ||
} | ||
|
||
## Post-installation required steps | ||
postInstall() { | ||
info "Post Install for $1" | ||
} | ||
|
||
## Installation exeution. | ||
## No need to change from this line on | ||
|
||
execute() { | ||
# Pre install steps | ||
preInstall "$TOOL_NAME" | ||
|
||
# Install tool | ||
install "$OS_METHODS" $TOOL_NAME "$EXTRA_INFO" | ||
|
||
# Post install steps | ||
postInstall "$TOOL_NAME" | ||
} | ||
|
||
_is_func_imported() { | ||
|
||
typeset TYPE_RESULT="$(type -t user)" | ||
|
||
if [ "$TYPE_RESULT" != 'function' ]; then | ||
#shellcheck source=/dev/null | ||
source "$DOTFILES_FOLDER"/lib/functions | ||
fi | ||
} | ||
|
||
_is_func_imported | ||
|
||
execute |