Skip to content

Commit

Permalink
fix: container scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
rharkor committed Oct 16, 2023
1 parent 313bc11 commit cedc3bc
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 46 deletions.
36 changes: 18 additions & 18 deletions .devcontainer/.p10k.zsh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Generated by Powerlevel10k configuration wizard on 2023-09-13 at 13:25 UTC.
# Generated by Powerlevel10k configuration wizard on 2023-10-16 at 13:51 UTC.
# Based on romkatv/powerlevel10k/config/p10k-classic.zsh, checksum 48479.
# Wizard options: awesome-patched + powerline, large icons, classic, unicode, light,
# 12h time, angled separators, sharp heads, sharp tails, 2 lines, solid, no frame,
# compact, many icons, concise, transient_prompt, instant_prompt=verbose.
# 24h time, angled separators, sharp heads, sharp tails, 2 lines, disconnected,
# left frame, compact, many icons, fluent, transient_prompt, instant_prompt=verbose.
# Type `p10k configure` to generate another config.
#
# Config for Powerlevel10k with classic powerline prompt style. Type `p10k configure` to generate
Expand Down Expand Up @@ -37,7 +37,7 @@
vcs # git status
# =========================[ Line #2 ]=========================
newline # \n
prompt_char # prompt symbol
# prompt_char # prompt symbol
)

# The list of segments shown on the right. Fill it with less important segments.
Expand Down Expand Up @@ -95,7 +95,7 @@
midnight_commander # midnight commander shell (https://midnight-commander.org/)
nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html)
chezmoi_shell # chezmoi shell (https://www.chezmoi.io/)
# vi_mode # vi mode (you don't need this if you've enabled prompt_char)
vi_mode # vi mode (you don't need this if you've enabled prompt_char)
# vpn_ip # virtual private network indicator
# load # CPU load
# disk_usage # disk usage
Expand Down Expand Up @@ -141,9 +141,9 @@

# Connect left prompt lines with these symbols. You'll probably want to use the same color
# as POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND below.
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX=
typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX=
typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX=
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX='%242F╭─'
typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX='%242Fβ”œβ”€'
typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX='%242F╰─'
# Connect right prompt lines with these symbols.
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX=
typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX=
Expand All @@ -153,7 +153,7 @@
# '─'. The last two make it easier to see the alignment between left and right prompt and to
# separate prompt from command output. You might want to set POWERLEVEL9K_PROMPT_ADD_NEWLINE=false
# for more compact prompt if using this option.
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR='─'
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' '
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_BACKGROUND=
typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_GAP_BACKGROUND=
if [[ $POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR != ' ' ]]; then
Expand Down Expand Up @@ -504,7 +504,7 @@
# Custom icon.
# typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_EXPANSION='⭐'
# Custom prefix.
# typeset -g POWERLEVEL9K_VCS_PREFIX='%248Fon '
typeset -g POWERLEVEL9K_VCS_PREFIX='%248Fon '

# Show status of repositories of these types. You can add svn and/or hg if you are
# using them. If you do, your prompt may become slow even when your current directory
Expand All @@ -524,7 +524,7 @@

# Status on success. No content, just an icon. No need to show it if prompt_char is enabled as
# it will signify success by turning green.
typeset -g POWERLEVEL9K_STATUS_OK=false
typeset -g POWERLEVEL9K_STATUS_OK=true
typeset -g POWERLEVEL9K_STATUS_OK_FOREGROUND=70
typeset -g POWERLEVEL9K_STATUS_OK_VISUAL_IDENTIFIER_EXPANSION='βœ”'

Expand All @@ -536,7 +536,7 @@

# Status when it's just an error code (e.g., '1'). No need to show it if prompt_char is enabled as
# it will signify error by turning red.
typeset -g POWERLEVEL9K_STATUS_ERROR=false
typeset -g POWERLEVEL9K_STATUS_ERROR=true
typeset -g POWERLEVEL9K_STATUS_ERROR_FOREGROUND=160
typeset -g POWERLEVEL9K_STATUS_ERROR_VISUAL_IDENTIFIER_EXPANSION='✘'

Expand Down Expand Up @@ -565,7 +565,7 @@
# Custom icon.
# typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐'
# Custom prefix.
# typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PREFIX='%248Ftook '
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PREFIX='%248Ftook '

#######################[ background_jobs: presence of background jobs ]#######################
# Don't show the number of background jobs.
Expand Down Expand Up @@ -941,7 +941,7 @@
# Custom icon.
# typeset -g POWERLEVEL9K_CONTEXT_VISUAL_IDENTIFIER_EXPANSION='⭐'
# Custom prefix.
# typeset -g POWERLEVEL9K_CONTEXT_PREFIX='%248Fwith '
typeset -g POWERLEVEL9K_CONTEXT_PREFIX='%248Fwith '

###[ virtualenv: python virtual environment (https://docs.python.org/3/library/venv.html) ]###
# Python virtual environment color.
Expand Down Expand Up @@ -1372,7 +1372,7 @@
POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${${:-/$P9K_KUBECONTEXT_NAMESPACE}:#/default}'

# Custom prefix.
# typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='%248Fat '
typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='%248Fat '

#[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]#
# Show aws only when the command you are typing invokes one of these tools.
Expand Down Expand Up @@ -1562,7 +1562,7 @@
# Custom icon.
# typeset -g POWERLEVEL9K_TOOLBOX_VISUAL_IDENTIFIER_EXPANSION='⭐'
# Custom prefix.
# typeset -g POWERLEVEL9K_TOOLBOX_PREFIX='%248Fin '
typeset -g POWERLEVEL9K_TOOLBOX_PREFIX='%248Fin '

###############################[ public_ip: public IP address ]###############################
# Public IP color.
Expand Down Expand Up @@ -1657,15 +1657,15 @@
# Current time color.
typeset -g POWERLEVEL9K_TIME_FOREGROUND=66
# Format for the current time: 09:51:02. See `man 3 strftime`.
typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%I:%M:%S %p}'
typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}'
# If set to true, time will update when you hit enter. This way prompts for the past
# commands will contain the start times of their commands as opposed to the default
# behavior where they contain the end times of their preceding commands.
typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false
# Custom icon.
# typeset -g POWERLEVEL9K_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐'
# Custom prefix.
# typeset -g POWERLEVEL9K_TIME_PREFIX='%248Fat '
typeset -g POWERLEVEL9K_TIME_PREFIX='%248Fat '

# Example of a user-defined prompt segment. Function prompt_example will be called on every
# prompt if `example` prompt segment is added to POWERLEVEL9K_LEFT_PROMPT_ELEMENTS or
Expand Down
13 changes: 7 additions & 6 deletions .devcontainer/.zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ ZSH_THEME="powerlevel10k/powerlevel10k"
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git)
plugins=(git zsh-autosuggestions)

source $ZSH/oh-my-zsh.sh

Expand Down Expand Up @@ -108,11 +108,12 @@ source $ZSH/oh-my-zsh.sh
# alias ohmyzsh="mate ~/.oh-my-zsh"
DISABLE_AUTO_UPDATE=true
DISABLE_UPDATE_PROMPT=true
ZSH_THEME="powerlevel10k/powerlevel10k"

# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh

POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true
source /home/node/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# bun
export BUN_INSTALL="$HOME/.bun"
export PATH=$BUN_INSTALL/bin:$PATH
export PATH=$BUN_INSTALL/bin:$PATH

# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
},

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "./scripts/install-zsh10k.sh && ./scripts/install-bun.sh && ./scripts/git-hooks.sh && npm install",
"postCreateCommand": "bash ./scripts/install/install.sh",

// Configure tool-specific properties.
"customizations": {
"postCreateCommand": "./scripts/install-zsh10k.sh && ./scripts/install-bun.sh && ./scripts/git-hooks.sh && npm install",
"postCreateCommand": "bash ./scripts/install/install.sh",
"vscode": {
"extensions": [
"formulahendry.auto-rename-tag",
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ yarn-error.log*
.pnpm-debug.log*

# local env files
.env
.env.development.local
.env.test.local
.env.production.local
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"test": "cross-env FORCE_COLOR=1 jest --passWithNoTests",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"postinstall": "npx patch-package && prisma generate",
"preinstall": "npx only-allow-many npm",
"preinstall": "npx -y only-allow-many npm",
"seed": "NODE_ENV=development prisma db seed",
"depcheck": "cd scripts && npm i && npm run depcheck",
"full-sub-package-setup": "npm run sub-package:scripts",
Expand Down
2 changes: 1 addition & 1 deletion scripts/complete-initialisation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const __dirname = url.fileURLToPath(new URL(".", import.meta.url))
const rootPath = path.join(__dirname, "..")

export const completeInitialisation = async () => {
await fs.unlink(path.join(rootPath, "scripts", ".init-todo"))
await fs.unlink(path.join(rootPath, "scripts", ".init-todo")).catch(() => {})
console.log("\n")
console.log(chalk.yellow("*".repeat(50)))
console.log(chalk.green("Project initialized!"))
Expand Down
11 changes: 0 additions & 11 deletions scripts/install-zsh10k.sh

This file was deleted.

4 changes: 1 addition & 3 deletions scripts/install-bun.sh β†’ scripts/install/install-bun.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#! /bin/zsh

echo "Installing bun... πŸš€"
curl -fsSL https://bun.sh/install | bash

echo "# bun" >> ~/.zshrc
echo "export BUN_INSTALL=\"\$HOME/.bun\"" >> ~/.zshrc
echo "export PATH=\$BUN_INSTALL/bin:\$PATH" >> ~/.zshrc

source /home/node/.zshrc
echo "Done! πŸŽ‰"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /bin/sh
echo "Installing git hooks... πŸš€"
npm install --global git-conventional-commits
git config core.hooksPath .git-hooks
git config core.hooksPath .git-hooks
echo "Done! πŸŽ‰"
18 changes: 18 additions & 0 deletions scripts/install/install-zsh10k.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# ZSH powerlevel10k
echo "Installing ZSH powerlevel10k... πŸš€"
#? Install powerlevel10k
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
# sed -i 's/ZSH_THEME=.*/ZSH_THEME="powerlevel10k\/powerlevel10k"/g' ${ZDOTDIR:-$HOME}/.zshrc
# echo '' >> ~/.zshrc
# echo 'POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true' >> ~/.zshrc
cp .devcontainer/.p10k.zsh ${ZDOTDIR:-$HOME}/.p10k.zsh
cp .devcontainer/.zshrc ${ZDOTDIR:-$HOME}/.zshrc

#? Install zsh syntax highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
echo "source ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc

#? Install zsh autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

echo "Done! πŸŽ‰"
9 changes: 9 additions & 0 deletions scripts/install/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
echo "πŸš€ Installing ZSH powerlevel10k..."
./scripts/install/install-zsh10k.sh 1>/dev/null 2>&1
echo "πŸ”₯ Installing bun..."
./scripts/install/install-bun.sh 1>/dev/null 2>&1
echo "πŸ› οΈ Installing git hooks..."
./scripts/install/install-git-hooks.sh 1>/dev/null 2>&1
echo "πŸ“¦ Installing dependencies..."
npm install 1>/dev/null 2>&1
echo "πŸŽ‰ Installing done!"
2 changes: 1 addition & 1 deletion scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"depcheck": "npx tsx depcheck.ts",
"is-initialized": "npx tsx is-initialized.ts",
"postinstall": "npx patch-package",
"preinstall": "npx only-allow-many npm"
"preinstall": "npx -y only-allow-many npm"
},
"type": "module",
"dependencies": {
Expand Down

0 comments on commit cedc3bc

Please sign in to comment.