-
-
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
1 parent
3804e08
commit de8eaa1
Showing
17 changed files
with
266 additions
and
71 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Ignore node_modules directory | ||
node_modules | ||
|
||
# Ignore npm debug logs | ||
npm-debug.log | ||
|
||
# Ignore yarn debug logs | ||
yarn-debug.log | ||
yarn-error.log | ||
|
||
# Ignore .env file (contains sensitive information) | ||
.env | ||
|
||
# Ignore any build artifacts or compiled code | ||
dist | ||
build | ||
out | ||
|
||
# Ignore any temporary files or caches | ||
*.tmp | ||
*.swp | ||
*.swo | ||
*.bak | ||
*.cache | ||
*.log |
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
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,4 @@ | ||
#!/bin/bash | ||
|
||
sudo apt-get install -y software-properties-common apt-transport-https lsb-release | ||
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install -y curl jq git |
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,10 @@ | ||
#!/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 | ||
brew upgrade |
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,35 @@ | ||
import BaseShell from './base_shell.mjs'; | ||
|
||
class Bash extends BaseShell { | ||
constructor(type = 'bash') { | ||
super(); | ||
this.type = type; | ||
} | ||
|
||
addCommand(command) { | ||
this.scripts.push(command + '\n'); | ||
} | ||
|
||
addEnvironment(path) { | ||
if (this.type === 'bash') { | ||
this.scripts.push(`echo ${path} >> ~/.bashrc\n`); | ||
this.scripts.push('source ~/.bashrc\n'); | ||
} else if (this.type === 'zsh') { | ||
this.scripts.push(`echo ${path} >> ~/.zshrc\n`); | ||
this.scripts.push('source ~/.zshrc\n'); | ||
} | ||
} | ||
|
||
script() { | ||
return ( | ||
'#!/bin/bash\n' + | ||
this.scripts | ||
.toString() | ||
.replace(/(^,)/gm, '') | ||
.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
Oops, something went wrong.