-
-
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: add for macOS and linux (Ubuntu)
- Loading branch information
Showing
15 changed files
with
209 additions
and
59 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
Empty file.
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,17 @@ | ||
#!/bin/bash | ||
|
||
sudo apt install -y curl software-properties-common apt-transport-https lsb-release | ||
sudo apt update && sudo apt upgrade -y && sudo apt install -y git | ||
|
||
# Load git-prompt.sh to use __git_ps1 for Git branch name | ||
echo "# Load git prompt script for version control information" >> ~/.bashrc | ||
echo "if type __git_ps1 &>/dev/null; then" >> ~/.bashrc | ||
echo " GIT_PS1_SHOWDIRTYSTATE=1" >> ~/.bashrc | ||
echo " GIT_PS1_SHOWSTASHSTATE=1" >> ~/.bashrc | ||
echo " GIT_PS1_SHOWUNTRACKEDFILES=1" >> ~/.bashrc | ||
echo " GIT_PS1_SHOWUPSTREAM='auto'" >> ~/.bashrc | ||
echo " PROMPT_COMMAND='__git_ps1 \"\\[\\e[32m\\]\\w\\[\\e[0m\\]\" \" \\\$ \" \""'"'%F{87}(%s)%f'"'"'\"'" >> ~/.bashrc | ||
echo "else" >> ~/.bashrc | ||
echo " PS1='\\[\\e[32m\\]\\w\\[\\e[0m\\] \$ '" >> ~/.bashrc | ||
echo "fi" >> ~/.bashrc | ||
echo "" >> ~/.bashrc |
Empty file.
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,9 @@ | ||
#!/bin/bash | ||
|
||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | ||
( | ||
echo | ||
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' | ||
) >>~/.zprofile | ||
eval "$(/opt/homebrew/bin/brew shellenv)" | ||
source ~/.zprofile |
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,14 @@ | ||
#!/bin/bash | ||
|
||
# Reset Launchpad | ||
# ////////////////////////////////////////////////// | ||
defaults write com.apple.dock ResetLaunchPad -bool true | ||
killall Dock | ||
|
||
# Display full path in Finder title bar | ||
# ////////////////////////////////////////////////// | ||
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true | ||
|
||
# Show path bar in Finder | ||
# ////////////////////////////////////////////////// | ||
defaults write com.apple.finder ShowPathbar -bool true |
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,14 @@ | ||
#!/bin/bash | ||
|
||
echo "# Load version control information" >>~/.zshrc | ||
echo "autoload -Uz vcs_info" >>~/.zshrc | ||
echo "precmd() { vcs_info }" >>~/.zshrc | ||
echo "" >>~/.zshrc | ||
echo "# Format the vcs_info_msg_0_ variable" >>~/.zshrc | ||
echo "zstyle ':vcs_info:git:*' formats ' %F{87}(%b)%f'" >>~/.zshrc | ||
echo "" >>~/.zshrc | ||
echo "# Set up the prompt (with git branch name)" >>~/.zshrc | ||
echo "setopt PROMPT_SUBST" >>~/.zshrc | ||
echo "PROMPT='[%F{82}%~%f]\${vcs_info_msg_0_} $ '" >>~/.zshrc | ||
echo "" >>~/.zshrc | ||
source ~/.zshrc |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
npm install -g npm | ||
npm install -g npm@latest | ||
npm install -g pnpm | ||
npm install -g npm-check-updates | ||
npm install -g @leoli0605/git-setup |
Empty file.
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,23 @@ | ||
class BaseShell { | ||
constructor() { | ||
this.commands = []; | ||
this.environment = []; | ||
this.scripts = []; | ||
} | ||
|
||
addCommand(command) { | ||
this.commands.push(command); | ||
console.log(`Command added: ${command}`); | ||
} | ||
|
||
addEnvironment(path) { | ||
this.environment.push(path); | ||
console.log(`Environment added: ${path}`); | ||
} | ||
|
||
script() { | ||
throw new Error('You have to implement the method script!'); | ||
} | ||
} | ||
|
||
export default BaseShell; |
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,24 @@ | ||
import BaseShell from './base_shell.mjs'; | ||
|
||
class Bash extends BaseShell { | ||
constructor(type = 'bash') { | ||
super(); | ||
this.type = type; | ||
} | ||
|
||
script() { | ||
for (const e of this.environment) { | ||
if (type === 'bash') { | ||
this.scripts.push(`echo ${e} >> ~/.bashrc\n`); | ||
} else if (type === 'zsh') { | ||
this.scripts.push(`echo ${e} >> ~/.zshrc\n`); | ||
} | ||
} | ||
this.scripts.push('source ~/.bashrc\n'); | ||
this.scripts.push('source ~/.zshrc\n'); | ||
this.scripts.push(this.commands.join('\n')); | ||
return '#!/bin/bash\n' + this.scripts.toString().replace(/#!\/bin\/bash/g, '') + '\n'; | ||
} | ||
} | ||
|
||
export default Bash; |
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 was deleted.
Oops, something went wrong.