Skip to content

Commit 2e5103b

Browse files
committed
feat(chrome): add script to open Google Chrome across platforms
1 parent 55fed2f commit 2e5103b

File tree

5 files changed

+21
-33
lines changed

5 files changed

+21
-33
lines changed

β€Žbin/chromeβ€Ž

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
3+
set -o pipefail
4+
5+
##? Open Google Chrome in different operating systems
6+
##?
7+
##? Usage:
8+
##? chrome [<url>...]
9+
10+
source "$DOTFILES_PATH/scripts/core/_main.sh"
11+
12+
if platform::is_macos; then
13+
open -a "Google Chrome" "$@"
14+
elif platform::is_linux; then
15+
google-chrome "$@"
16+
else
17+
log::error "Unsupported platform"
18+
exit 1
19+
fi

β€Žscripts/package/importβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ if platform::command_exists apt-mark; then
7272
_apt_import
7373
fi
7474

75-
if ! platform::is_wsl && platform::command_exists snap; then
75+
if platform::command_exists snap; then
7676
log::info "πŸ“₯ Installing snap packages"
7777
_snap_import
7878
fi

β€Žscripts/self/utils/install.shβ€Ž

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ install_requirements() {
1010
elif platform::is_macos; then
1111
log::info "🍎 Setting up MacOS platform"
1212
_install_macos_requirements
13-
elif platform::is_wsl; then
14-
log::info"πŸš€ Setting up WSL platform"
15-
_install_wsl_requirements
1613
fi
1714
}
1815

@@ -51,14 +48,3 @@ _install_linux_requirements() {
5148
_install_apt_package gcc
5249
fi
5350
}
54-
55-
_install_wsl_requirements() {
56-
_install_apt_package() {
57-
sudo apt-get install -y $1 2>&1 | log::file "πŸ“¦ Installing apt $1"
58-
}
59-
60-
if platform::command_exists apt-mark; then
61-
_install_apt_package zsh
62-
_install_apt_package gcc
63-
fi
64-
}

β€Žscripts/self/utils/update.shβ€Ž

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ update_system() {
1919
elif platform::is_macos; then
2020
log::info "πŸ” Updating MacOS platform"
2121
_update_macos 2>&1 | log::file "πŸ” Updating MacOS platform"
22-
elif platform::is_wsl; then
23-
log::info"πŸ” Updating WSL platform"
24-
_update_wsl 2>&1 | log::file "πŸ” Updating WSL platform"
2522
fi
2623
}
2724

@@ -44,17 +41,3 @@ _update_linux() {
4441
brew update && brew upgrade && brew cleanup
4542
fi
4643
}
47-
48-
_update_wsl() {
49-
if platform::command_exists apt-mark; then
50-
sudo apt-get update -y
51-
sudo apt-get upgrade -y
52-
sudo apt-get autoremove -y
53-
fi
54-
if platform::command_exists snap; then
55-
sudo snap refresh
56-
fi
57-
if platform::command_exists brew; then
58-
brew update && brew upgrade && brew cleanup
59-
fi
60-
}

β€Žshell/exports.shβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ _pathadd() {
77
export EDITOR='vim'
88

99
# Default browser
10-
export BROWSER='google-chrome'
10+
export BROWSER="$DOTFILES_PATH/bin/chrome"
1111

1212
# Default pager
1313
export PAGER='less'

0 commit comments

Comments
Β (0)