summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/deploy/jv_cli.ps163
-rwxr-xr-xscripts/deploy/jv_cli.sh74
-rwxr-xr-xscripts/deploy/legacy_completions/bash/completion_jv.sh272
-rwxr-xr-xscripts/deploy/legacy_completions/bash/completion_jvv.sh78
-rw-r--r--scripts/deploy/legacy_completions/powershell/completion_jv.ps1250
-rw-r--r--scripts/deploy/legacy_completions/powershell/completion_jvv.ps167
-rw-r--r--scripts/deploy/legacy_zsh_support/how_to_install.md61
-rwxr-xr-xscripts/deploy/legacy_zsh_support/install.sh3
-rw-r--r--scripts/deploy/legacy_zsh_support/jvcs.plugin.zsh156
-rw-r--r--scripts/make_lnk.ps127
-rw-r--r--scripts/make_lnk.sh25
-rw-r--r--scripts/setup/linux/inst.sh88
-rw-r--r--scripts/setup/windows/post_inst.ps1 (renamed from scripts/setup/windows/inst.ps1)0
-rw-r--r--scripts/setup/windows/post_uninst.ps1 (renamed from scripts/setup/windows/uninst.ps1)0
14 files changed, 0 insertions, 1164 deletions
diff --git a/scripts/deploy/jv_cli.ps1 b/scripts/deploy/jv_cli.ps1
deleted file mode 100644
index 3de330a..0000000
--- a/scripts/deploy/jv_cli.ps1
+++ /dev/null
@@ -1,63 +0,0 @@
-$SCRIPT_DIR = Split-Path -Parent $MyInvocation.MyCommand.Definition
-
-##############
-### CONFIG ###
-##############
-
-# Use JV_LANG to set CLI language
-# Supported: en, zh-CN
-# $env:JV_LANG = "en"
-
-# Use JV_AUTO_UPDATE to set auto content update (yes/no)
-# After local operations that change Upstream Vault content
-# Next `jv` command will auto-run `jv update`
-$env:JV_AUTO_UPDATE = "yes"
-
-# Use JV_OUTDATED_MINUTES to set the expiration time (in minutes), requires JV_AUTO_UPDATE to be enabled
-# Next time the `jv` command is used, if the content is outdated, `jv update` will be automatically executed
-# When the set number is < 0, timeout-based update is disabled
-# When the set number = 0, update runs every time (not recommended)
-# When the set number > 0, update according to the specified time
-# If not set, the default is -1
-# $env:JV_OUTDATED_MINUTES = "5"
-
-# Use JV_TEXT_EDITOR to set text editor for `jv track --work` `jv align --work`
-# DEFAULT: $EDITOR environment variable, falling back to "jvii" if not set
-# $env:JV_TEXT_EDITOR = "nano"
-
-###############
-### ALIASES ###
-###############
-
-function jv {
- & (Get-Command jv -CommandType Application) @args
-}
-
-function jvh { jv here @args }
-function jvu { jv update @args }
-function jvt { jv track @args }
-function jmv { jv move @args }
-
-Set-Alias jvh jvh
-Set-Alias jvu jvu
-Set-Alias jvt jvt
-Set-Alias jmv jmv
-
-##################
-### COMPLETION ###
-##################
-
-if (Test-Path "$SCRIPT_DIR\_legacy\comp\jv.ps1") {
- . "$SCRIPT_DIR\comp\jv.ps1"
-}
-if (Test-Path "$SCRIPT_DIR\_legacy\comp\jvv.ps1") {
- . "$SCRIPT_DIR\comp\jvv.ps1"
-}
-
-###################
-### ENVIRONMENT ###
-###################
-
-if (Test-Path "$SCRIPT_DIR\bin") {
- $env:PATH = "$SCRIPT_DIR\bin;" + $env:PATH
-}
diff --git a/scripts/deploy/jv_cli.sh b/scripts/deploy/jv_cli.sh
deleted file mode 100755
index b5212af..0000000
--- a/scripts/deploy/jv_cli.sh
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/bin/bash
-SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
-
-##############
-### CONFIG ###
-##############
-
-# Use JV_LANG to set CLI language
-# Supported: en, zh-CN
-# export JV_LANG=en
-
-# Use JV_AUTO_UPDATE to set auto content update (yes/no)
-# After local operations that change Upstream Vault content
-# Next `jv` command will auto-run `jv update`
-export JV_AUTO_UPDATE=yes
-
-# Use JV_OUTDATED_MINUTES to set the expiration time (in minutes), requires JV_AUTO_UPDATE to be enabled
-# Next time the `jv` command is used, if the content is outdated, `jv update` will be automatically executed
-# When the set number is < 0, timeout-based update is disabled
-# When the set number = 0, update runs every time (not recommended)
-# When the set number > 0, update according to the specified time
-# If not set, the default is -1
-# export JV_OUTDATED_MINUTES=5
-
-# Use JV_TEXT_EDITOR to set text editor for `jv track --work` `jv align --work`
-# DEFAULT: $EDITOR environment variable, falling back to "jvii" if not set
-# export JV_TEXT_EDITOR=nano
-
-###############
-### ALIASES ###
-###############
-
-# Disable glob expansion for jv commands across shells
-if [ -n "$BASH_VERSION" ]; then # Bash
- alias jv='set -f; command jv; set +f'
- alias jvt='set -f; command jv track; set +f'
- alias jmv='set -f; command jv move; set +f'
-elif [ -n "$ZSH_VERSION" ]; then # Zsh
- alias jv='noglob jv'
- alias jvt='noglob jv track'
- alias jmv='noglob jv move'
-elif [ -n "$FISH_VERSION" ]; then # Fish
- function jv {
- command jv $@
- }
- function jvt {
- command jv track $@
- }
- function jmv {
- command jv move $@
- }
-fi
-
-alias jvh='jv here'
-alias jvu='jv update'
-
-##################
-### COMPLETION ###
-##################
-
-if [ -f "$SCRIPT_DIR/_legacy/comp/jv.sh" ]; then
- source "$SCRIPT_DIR/_legacy/comp/jv.sh"
-fi
-if [ -f "$SCRIPT_DIR/_legacy/comp/jvv.sh" ]; then
- source "$SCRIPT_DIR/_legacy/comp/jvv.sh"
-fi
-
-##################
-### ENVIREMENT ###
-##################
-
-if [ -d "$SCRIPT_DIR/bin" ]; then
- export PATH="$SCRIPT_DIR/bin:$PATH"
-fi
diff --git a/scripts/deploy/legacy_completions/bash/completion_jv.sh b/scripts/deploy/legacy_completions/bash/completion_jv.sh
deleted file mode 100755
index 364df9d..0000000
--- a/scripts/deploy/legacy_completions/bash/completion_jv.sh
+++ /dev/null
@@ -1,272 +0,0 @@
-#!/bin/bash
-# The JustEnoughVCS CommandLine Completion
-
-_jv_completion() {
- local cur prev words cword
- COMPREPLY=()
- cur="${COMP_WORDS[COMP_CWORD]}"
- prev="${COMP_WORDS[COMP_CWORD-1]}"
- words=("${COMP_WORDS[@]}")
- cword=$COMP_CWORD
-
- # Current
- local cmd="${words[0]}"
- local subcmd="${words[1]}"
- local subsubcmd="${words[2]}"
-
- # Subcommands
- local base_commands="create init direct unstain account update \
- sheet status here move mv docs exit use sheets accounts \
- as make drop track hold throw login \
- jump align info share"
-
- # Subcommands - Account
- local account_commands="list as add remove movekey mvkey mvk genpub help"
-
- # Subcommands - Sheet
- local sheet_commands="list use exit make drop help align"
-
- # Subcommands - Sheet
- local sheet_commands="list use exit make drop help align"
-
- # Completion subcommands
- if [[ $cword -eq 1 ]]; then
- COMPREPLY=($(compgen -W "$base_commands" -- "$cur"))
- return 0
- fi
-
- # Completion account
- if [[ "$subcmd" == "account" || "$subcmd" == "acc" ]]; then
- if [[ $cword -eq 2 ]]; then
- COMPREPLY=($(compgen -W "$account_commands" -- "$cur"))
- return 0
- fi
-
- case "$subsubcmd" in
- "as"|"remove"|"mvkey"|"mvk"|"movekey"|"genpub")
- if [[ $cword -eq 3 ]]; then
- # Use jv account list --raw
- local accounts
- accounts=$($cmd account list --raw 2>/dev/null)
- COMPREPLY=($(compgen -W "$accounts" -- "$cur"))
- elif [[ $cword -eq 4 && ("$subsubcmd" == "mvkey" || "$subsubcmd" == "mvk" || "$subsubcmd" == "movekey" || "$subsubcmd" == "genpub") ]]; then
- COMPREPLY=($(compgen -f -- "$cur"))
- fi
- ;;
- "add")
- if [[ $cword -eq 3 ]]; then
- # No completion for account name, let user type it
- COMPREPLY=()
- elif [[ $cword -eq 4 && "$cur" == -* ]]; then
- # Complete --keygen option
- COMPREPLY=($(compgen -W "--keygen" -- "$cur"))
- fi
- ;;
- "-"|"rm")
- if [[ $cword -eq 3 ]]; then
- local accounts
- accounts=$($cmd account list --raw 2>/dev/null)
- COMPREPLY=($(compgen -W "$accounts" -- "$cur"))
- fi
- ;;
- esac
- return 0
- fi
-
- # Completion sheet
- if [[ "$subcmd" == "sheet" || "$subcmd" == "sh" ]]; then
- if [[ $cword -eq 2 ]]; then
- COMPREPLY=($(compgen -W "$sheet_commands" -- "$cur"))
- return 0
- fi
-
- case "$subsubcmd" in
- # Use jv sheet list --raw --all/--other
- "use"|"drop")
- if [[ $cword -eq 3 ]]; then
- local sheets
- sheets=$($cmd sheet list --raw 2>/dev/null)
- COMPREPLY=($(compgen -W "$sheets" -- "$cur"))
- fi
- ;;
- "make")
- if [[ $cword -eq 3 ]]; then
- local all_sheets
- all_sheets=$($cmd sheet list --all --raw 2>/dev/null)
- COMPREPLY=($(compgen -W "$all_sheets" -- "$cur"))
- fi
- ;;
- "align")
- if [[ $cword -eq 3 ]]; then
- local align_items="lost moved erased"
- local unsolved_items
- unsolved_items=$($cmd sheet align --unsolved --raw 2>/dev/null)
- COMPREPLY=($(compgen -W "$align_items $unsolved_items" -- "$cur"))
- elif [[ $cword -eq 4 ]]; then
- local item="${words[3]}"
- local align_operations=""
- local created_items
- created_items=$($cmd sheet align --created --raw 2>/dev/null)
-
- if [[ "$item" == "lost" ]]; then
- align_operations="confirm"
- elif [[ "$item" == lost:* ]]; then
- align_operations="confirm $created_items"
- elif [[ "$item" == "moved" || "$item" == moved:* ]]; then
- align_operations="local remote break"
- elif [[ "$item" == "erased" || "$item" == erased:* ]]; then
- align_operations="confirm"
- else
- align_operations="local remote confirm break $created_items"
- fi
-
- COMPREPLY=($(compgen -W "$align_operations" -- "$cur"))
- fi
- ;;
- esac
- return 0
- fi
-
- # Completion align
- if [[ "$subcmd" == "align" ]]; then
- if [[ $cword -eq 2 ]]; then
- local align_items="lost moved erased"
- local unsolved_items
- unsolved_items=$($cmd sheet align --unsolved --raw 2>/dev/null)
- COMPREPLY=($(compgen -W "$align_items $unsolved_items" -- "$cur"))
- elif [[ $cword -eq 3 ]]; then
- local item="${words[2]}"
- local align_operations=""
- local created_items
- created_items=$($cmd sheet align --created --raw 2>/dev/null)
-
- if [[ "$item" == "lost" ]]; then
- align_operations="confirm"
- elif [[ "$item" == lost:* ]]; then
- align_operations="confirm $created_items"
- elif [[ "$item" == "moved" || "$item" == moved:* ]]; then
- align_operations="local remote break"
- elif [[ "$item" == "erased" || "$item" == erased:* ]]; then
- align_operations="confirm"
- else
- align_operations="local remote confirm break $created_items"
- fi
-
- COMPREPLY=($(compgen -W "$align_operations" -- "$cur"))
- fi
- return 0
- fi
-
- # Completion share
- if [[ "$subcmd" == "share" ]]; then
- if [[ $cword -eq 2 ]]; then
- # First parameter: list, see, jv share list --raw results, or files
- local share_list
- share_list=$($cmd share list --raw 2>/dev/null)
- local first_param_options="list see $share_list"
- COMPREPLY=($(compgen -W "$first_param_options" -f -- "$cur"))
- elif [[ $cword -eq 3 ]]; then
- # Second parameter: depends on first parameter
- local first_param="${words[2]}"
-
- if [[ "$first_param" == "list" ]]; then
- # list -> nothing
- COMPREPLY=()
- elif [[ "$first_param" == "see" ]]; then
- # see -> jv share list --raw results
- local share_list
- share_list=$($cmd share list --raw 2>/dev/null)
- COMPREPLY=($(compgen -W "$share_list" -- "$cur"))
- elif [[ "$first_param" == *"@"* ]]; then
- # Contains "@" (shareid) -> show options
- COMPREPLY=($(compgen -W "--safe --overwrite --skip --reject" -- "$cur"))
- else
- # File input -> show jv sheet list --all --raw results
- local all_sheets
- all_sheets=$($cmd sheet list --all --raw 2>/dev/null)
- COMPREPLY=($(compgen -W "$all_sheets" -- "$cur"))
- fi
- fi
- # Third parameter: no completion
- return 0
- fi
-
- # Completion login
- if [[ "$subcmd" == "login" ]]; then
- if [[ $cword -eq 2 ]]; then
- local accounts
- accounts=$($cmd account list --raw 2>/dev/null)
- COMPREPLY=($(compgen -W "$accounts" -- "$cur"))
- elif [[ $cword -eq 3 ]]; then
- local ip_history
- ip_history=$($cmd _ip_history 2>/dev/null)
- COMPREPLY=($(compgen -W "$ip_history" -- "$cur"))
- fi
- return 0
- fi
-
- # Completion direct
- if [[ "$subcmd" == "direct" ]]; then
- if [[ $cword -eq 2 ]]; then
- local ip_history
- ip_history=$($cmd _ip_history 2>/dev/null)
- COMPREPLY=($(compgen -W "$ip_history" -- "$cur"))
- fi
- return 0
- fi
-
- # Completion info
- if [[ "$subcmd" == "info" ]]; then
- if [[ $cword -eq 2 ]]; then
- COMPREPLY=($(compgen -f -- "$cur"))
- fi
- return 0
- fi
-
- # aliases
- case "$subcmd" in
- "as")
- if [[ $cword -eq 2 ]]; then
- local accounts
- accounts=$($cmd account list --raw 2>/dev/null)
- COMPREPLY=($(compgen -W "$accounts" -- "$cur"))
- fi
- ;;
- "use")
- if [[ $cword -eq 2 ]]; then
- local sheets
- sheets=$($cmd sheet list --raw 2>/dev/null)
- COMPREPLY=($(compgen -W "$sheets" -- "$cur"))
- fi
- ;;
- "make")
- if [[ $cword -eq 2 ]]; then
- local all_sheets
- all_sheets=$($cmd sheet list --all --raw 2>/dev/null)
- COMPREPLY=($(compgen -W "$all_sheets" -- "$cur"))
- fi
- ;;
- "drop")
- if [[ $cword -eq 2 ]]; then
- local sheets
- sheets=$($cmd sheet list --raw 2>/dev/null)
- COMPREPLY=($(compgen -W "$sheets" -- "$cur"))
- fi
- ;;
- "docs")
- if [[ $cword -eq 2 ]]; then
- local docs
- docs=$($cmd docs list --raw 2>/dev/null)
- COMPREPLY=($(compgen -W "$docs" -- "$cur"))
- fi
- ;;
- "move"|"mv")
- COMPREPLY=($(compgen -f -- "$cur"))
- ;;
- "track"|"hold"|"throw")
- COMPREPLY=($(compgen -f -- "$cur"))
- ;;
- esac
-}
-
-complete -F _jv_completion jv
diff --git a/scripts/deploy/legacy_completions/bash/completion_jvv.sh b/scripts/deploy/legacy_completions/bash/completion_jvv.sh
deleted file mode 100755
index ce5668b..0000000
--- a/scripts/deploy/legacy_completions/bash/completion_jvv.sh
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/bin/bash
-# The JustEnoughVCS CommandLine Completion
-
-_jvv_completion() {
- local cur prev words cword
- COMPREPLY=()
- cur="${COMP_WORDS[COMP_CWORD]}"
- prev="${COMP_WORDS[COMP_CWORD-1]}"
- words=("${COMP_WORDS[@]}")
- cword=$COMP_CWORD
-
- # Current
- local cmd="${words[0]}"
- local subcmd="${words[1]}"
- local subsubcmd="${words[2]}"
-
- # Subcommands
- local base_commands="create init here member service listen members -c -i -H -m -l -M"
-
- # Subcommands - Member
- local member_commands="register remove list help + - ls"
-
- # Subcommands - Service
- local service_commands="listen help"
-
- # Completion subcommands
- if [[ $cword -eq 1 ]]; then
- COMPREPLY=($(compgen -W "$base_commands" -- "$cur"))
- return 0
- fi
-
- # Completion member
- if [[ "$subcmd" == "member" || "$subcmd" == "-m" ]]; then
- if [[ $cword -eq 2 ]]; then
- COMPREPLY=($(compgen -W "$member_commands" -- "$cur"))
- return 0
- fi
-
- case "$subsubcmd" in
- "remove"|"-")
- if [[ $cword -eq 3 ]]; then
- # Use jvv member list --raw
- local members
- members=$($cmd member list --raw 2>/dev/null)
- COMPREPLY=($(compgen -W "$members" -- "$cur"))
- fi
- ;;
- esac
- return 0
- fi
-
- # Completion service
- if [[ "$subcmd" == "service" ]]; then
- if [[ $cword -eq 2 ]]; then
- COMPREPLY=($(compgen -W "$service_commands" -- "$cur"))
- return 0
- fi
- return 0
- fi
-
- # aliases
- case "$subcmd" in
- "-m")
- if [[ $cword -eq 2 ]]; then
- COMPREPLY=($(compgen -W "$member_commands" -- "$cur"))
- fi
- ;;
- "listen"|"-l")
- # listen command has no arguments to complete
- ;;
- "members"|"-M")
- # members command has no arguments to complete
- ;;
- esac
-}
-
-# Register completion function
-complete -F _jvv_completion jvv
diff --git a/scripts/deploy/legacy_completions/powershell/completion_jv.ps1 b/scripts/deploy/legacy_completions/powershell/completion_jv.ps1
deleted file mode 100644
index 84ba01a..0000000
--- a/scripts/deploy/legacy_completions/powershell/completion_jv.ps1
+++ /dev/null
@@ -1,250 +0,0 @@
-# The JustEnoughVCS CommandLine Completion
-
-Register-ArgumentCompleter -Native -CommandName jv -ScriptBlock {
- param($wordToComplete, $commandAst, $cursorPosition)
-
- $words = $commandAst.CommandElements | ForEach-Object { $_.ToString() }
- $currentIndex = $words.IndexOf($wordToComplete)
- if ($currentIndex -lt 0) { $currentIndex = $words.Count }
-
- $cmd = "jv"
- $subcmd = if ($words.Count -gt 1) { $words[1] } else { $null }
- $subsubcmd = if ($words.Count -gt 2) { $words[2] } else { $null }
-
- # Base commands
- $baseCommands = @(
- "create", "init", "direct", "unstain", "account", "update",
- "sheet", "status", "here", "move", "mv", "docs", "exit", "use", "sheets", "accounts",
- "as", "make", "drop", "track", "hold", "throw", "login",
- "jump", "align", "info", "share"
- )
-
- # Account subcommands
- $accountCommands = @("list", "as", "add", "remove", "movekey", "mvkey", "mvk", "genpub", "help")
-
- # Sheet subcommands
- $sheetCommands = @("list", "use", "exit", "make", "drop", "help", "align")
-
- # Completion for main command
- if ($currentIndex -eq 1) {
- return $baseCommands | Where-Object { $_ -like "$wordToComplete*" }
- }
-
- # Completion for account command
- if ($subcmd -eq "account" -or $subcmd -eq "acc") {
- if ($currentIndex -eq 2) {
- return $accountCommands | Where-Object { $_ -like "$wordToComplete*" }
- }
-
- switch ($subsubcmd) {
- { @("as", "remove", "mvkey", "mvk", "movekey", "genpub") -contains $_ } {
- if ($currentIndex -eq 3) {
- $accounts = & $cmd account list --raw 2>$null
- return $accounts | Where-Object { $_ -like "$wordToComplete*" }
- } elseif ($currentIndex -eq 4 -and (@("mvkey", "mvk", "movekey", "genpub") -contains $subsubcmd)) {
- # File completion for key files
- return Get-ChildItem -Name -File -Path "." | Where-Object { $_ -like "$wordToComplete*" }
- }
- }
- "add" {
- if ($currentIndex -eq 3) {
- # No completion for account name
- return @()
- } elseif ($currentIndex -eq 4 -and $wordToComplete.StartsWith("-")) {
- # Complete --keygen option
- if ("--keygen" -like "$wordToComplete*") {
- return "--keygen"
- }
- }
- }
- { @("-", "rm") -contains $_ } {
- if ($currentIndex -eq 3) {
- $accounts = & $cmd account list --raw 2>$null
- return $accounts | Where-Object { $_ -like "$wordToComplete*" }
- }
- }
- }
- return @()
- }
-
- # Completion for sheet command
- if ($subcmd -eq "sheet" -or $subcmd -eq "sh") {
- if ($currentIndex -eq 2) {
- return $sheetCommands | Where-Object { $_ -like "$wordToComplete*" }
- }
-
- switch ($subsubcmd) {
- { @("use", "drop") -contains $_ } {
- if ($currentIndex -eq 3) {
- $sheets = & $cmd sheet list --raw 2>$null
- return $sheets | Where-Object { $_ -like "$wordToComplete*" }
- }
- }
- "make" {
- if ($currentIndex -eq 3) {
- $allSheets = & $cmd sheet list --all --raw 2>$null
- return $allSheets | Where-Object { $_ -like "$wordToComplete*" }
- }
- }
- "align" {
- if ($currentIndex -eq 3) {
- $alignItems = @("lost", "moved", "erased")
- $unsolvedItems = & $cmd sheet align --unsolved --raw 2>$null
- $completions = $alignItems + $unsolvedItems
- return $completions | Where-Object { $_ -like "$wordToComplete*" }
- } elseif ($currentIndex -eq 4) {
- $item = $words[3]
- $alignOperations = @()
- $createdItems = & $cmd sheet align --created --raw 2>$null
-
- if ($item -eq "lost") {
- $alignOperations = @("confirm")
- } elseif ($item -like "lost:*") {
- $alignOperations = @("confirm") + $createdItems
- } elseif ($item -eq "moved" -or $item -like "moved:*") {
- $alignOperations = @("local", "remote", "break")
- } elseif ($item -eq "erased" -or $item -like "erased:*") {
- $alignOperations = @("confirm")
- } else {
- $alignOperations = @("local", "remote", "confirm", "break") + $createdItems
- }
-
- return $alignOperations | Where-Object { $_ -like "$wordToComplete*" }
- }
- }
- }
- return @()
- }
-
- # Completion for align command
- if ($subcmd -eq "align") {
- if ($currentIndex -eq 2) {
- $alignItems = @("lost", "moved", "erased")
- $unsolvedItems = & $cmd sheet align --unsolved --raw 2>$null
- $completions = $alignItems + $unsolvedItems
- return $completions | Where-Object { $_ -like "$wordToComplete*" }
- } elseif ($currentIndex -eq 3) {
- $item = $words[2]
- $alignOperations = @()
- $createdItems = & $cmd sheet align --created --raw 2>$null
-
- if ($item -eq "lost") {
- $alignOperations = @("confirm")
- } elseif ($item -like "lost:*") {
- $alignOperations = @("confirm") + $createdItems
- } elseif ($item -eq "moved" -or $item -like "moved:*") {
- $alignOperations = @("local", "remote", "break")
- } elseif ($item -eq "erased" -or $item -like "erased:*") {
- $alignOperations = @("confirm")
- } else {
- $alignOperations = @("local", "remote", "confirm", "break") + $createdItems
- }
-
- return $alignOperations | Where-Object { $_ -like "$wordToComplete*" }
- }
- return @()
- }
-
- # Completion for login command
- if ($subcmd -eq "login") {
- if ($currentIndex -eq 2) {
- $accounts = & $cmd account list --raw 2>$null
- return $accounts | Where-Object { $_ -like "$wordToComplete*" }
- } elseif ($currentIndex -eq 3) {
- $ipHistory = & $cmd _ip_history 2>$null
- return $ipHistory | Where-Object { $_ -like "$wordToComplete*" }
- }
- return @()
- }
-
- # Completion for direct command
- if ($subcmd -eq "direct") {
- if ($currentIndex -eq 2) {
- $ipHistory = & $cmd _ip_history 2>$null
- return $ipHistory | Where-Object { $_ -like "$wordToComplete*" }
- }
- return @()
- }
-
- # Completion for info command
- if ($subcmd -eq "info") {
- if ($currentIndex -eq 2) {
- # File completion for the file argument
- return Get-ChildItem -Name -File -Path "." | Where-Object { $_ -like "$wordToComplete*" }
- }
- return @()
- }
-
- # Completion for share command
- if ($subcmd -eq "share") {
- if ($currentIndex -eq 2) {
- # First parameter: list, see, jv share list --raw results, or files in current directory
- $staticOptions = @("list", "see")
- $shareList = & $cmd share list --raw 2>$null
- $files = Get-ChildItem -Name -File -Path "." 2>$null
- $completions = $staticOptions + $shareList + $files
- return $completions | Where-Object { $_ -like "$wordToComplete*" }
- } elseif ($currentIndex -eq 3) {
- # Second parameter: depends on the first parameter
- $firstParam = $words[2]
- if ($firstParam -eq "list") {
- # list -> nothing
- return @()
- } elseif ($firstParam -eq "see") {
- # see -> jv share list --raw results
- $shareList = & $cmd share list --raw 2>$null
- return $shareList | Where-Object { $_ -like "$wordToComplete*" }
- } elseif ($firstParam -like "*@*") {
- # Contains "@" (shareid) -> show options
- $options = @("--safe", "--overwrite", "--skip", "--reject")
- return $options | Where-Object { $_ -like "$wordToComplete*" }
- } else {
- # Otherwise, assume it's a file -> show jv sheet list --all --raw results
- $allSheets = & $cmd sheet list --all --raw 2>$null
- return $allSheets | Where-Object { $_ -like "$wordToComplete*" }
- }
- }
- # Third parameter: no completion
- return @()
- }
-
- # Aliases completion
- switch ($subcmd) {
- "as" {
- if ($currentIndex -eq 2) {
- $accounts = & $cmd account list --raw 2>$null
- return $accounts | Where-Object { $_ -like "$wordToComplete*" }
- }
- }
- "use" {
- if ($currentIndex -eq 2) {
- $sheets = & $cmd sheet list --raw 2>$null
- return $sheets | Where-Object { $_ -like "$wordToComplete*" }
- }
- }
- "make" {
- if ($currentIndex -eq 2) {
- $allSheets = & $cmd sheet list --all --raw 2>$null
- return $allSheets | Where-Object { $_ -like "$wordToComplete*" }
- }
- }
- "drop" {
- if ($currentIndex -eq 2) {
- $sheets = & $cmd sheet list --raw 2>$null
- return $sheets | Where-Object { $_ -like "$wordToComplete*" }
- }
- }
- "docs" {
- if ($currentIndex -eq 2) {
- $docs = & $cmd docs list --raw 2>$null
- return $docs | Where-Object { $_ -like "$wordToComplete*" }
- }
- }
- { @("move", "mv", "track", "hold", "throw") -contains $_ } {
- # File completion for file operations
- return Get-ChildItem -Name -File -Path "." | Where-Object { $_ -like "$wordToComplete*" }
- }
- }
-
- return @()
-}
diff --git a/scripts/deploy/legacy_completions/powershell/completion_jvv.ps1 b/scripts/deploy/legacy_completions/powershell/completion_jvv.ps1
deleted file mode 100644
index fa773c0..0000000
--- a/scripts/deploy/legacy_completions/powershell/completion_jvv.ps1
+++ /dev/null
@@ -1,67 +0,0 @@
-# The JustEnoughVCS CommandLine Completion
-
-Register-ArgumentCompleter -Native -CommandName jvv -ScriptBlock {
- param($wordToComplete, $commandAst, $cursorPosition)
-
- $words = $commandAst.CommandElements | ForEach-Object { $_.ToString() }
- $currentIndex = $words.IndexOf($wordToComplete)
- if ($currentIndex -lt 0) { $currentIndex = $words.Count }
-
- $cmd = "jvv"
- $subcmd = if ($words.Count -gt 1) { $words[1] } else { $null }
- $subsubcmd = if ($words.Count -gt 2) { $words[2] } else { $null }
-
- # Base commands
- $baseCommands = @("create", "init", "here", "member", "service", "listen", "members", "-c", "-i", "-H", "-m", "-l", "-M")
-
- # Member subcommands
- $memberCommands = @("register", "remove", "list", "help", "+", "-", "ls")
-
- # Service subcommands
- $serviceCommands = @("listen", "help")
-
- # Completion for main command
- if ($currentIndex -eq 1) {
- return $baseCommands | Where-Object { $_ -like "$wordToComplete*" }
- }
-
- # Completion for member command
- if ($subcmd -eq "member" -or $subcmd -eq "-m") {
- if ($currentIndex -eq 2) {
- return $memberCommands | Where-Object { $_ -like "$wordToComplete*" }
- }
-
- switch ($subsubcmd) {
- { @("remove", "-") -contains $_ } {
- if ($currentIndex -eq 3) {
- $members = & $cmd member list --raw 2>$null
- return $members | Where-Object { $_ -like "$wordToComplete*" }
- }
- }
- }
- return @()
- }
-
- # Completion for service command
- if ($subcmd -eq "service") {
- if ($currentIndex -eq 2) {
- return $serviceCommands | Where-Object { $_ -like "$wordToComplete*" }
- }
- return @()
- }
-
- # Aliases completion
- switch ($subcmd) {
- "-m" {
- if ($currentIndex -eq 2) {
- return $memberCommands | Where-Object { $_ -like "$wordToComplete*" }
- }
- }
- { @("listen", "-l", "members", "-M") -contains $_ } {
- # These commands have no arguments to complete
- return @()
- }
- }
-
- return @()
-}
diff --git a/scripts/deploy/legacy_zsh_support/how_to_install.md b/scripts/deploy/legacy_zsh_support/how_to_install.md
deleted file mode 100644
index 343ea7b..0000000
--- a/scripts/deploy/legacy_zsh_support/how_to_install.md
+++ /dev/null
@@ -1,61 +0,0 @@
-# How to Install
-
-Before installing, please ensure:
-
-* [Oh My Zsh](https://ohmyz.sh/) is installed.
-* Your current shell is **Zsh**.
-
----
-
-## Install the Zsh Plugin
-
-In your terminal, run:
-
-```bash
-./install.sh
-```
-
-This script will install JVCS's Zsh support files locally and prepare the prompt segment definitions for use by your theme.
-
----
-
-## Configure Your Zsh Theme
-
-Open your current Zsh theme file (e.g., `~/.oh-my-zsh/themes/xxx.zsh-theme`) and paste the following content in an appropriate location:
-
-```bash
-# ----------------------------------------------------- #
-# DISPLAY_LEVEL
-# FULL = 127.0.0.1:25331/account/sheet
-# NORMAL = account/sheet
-# SHORT = sheet
-JVCS_VIEW='NORMAL'
-
-# Customizable prompt segment elements
-JVCS_PREFIX='['
-JVCS_SPLIT='/'
-JVCS_SUFFIX=']'
-
-# JVCS_PROMPT_SEGMENT default style:
-# [your_account/your_sheet]
-
-# Append JVCS prompt segment
-PROMPT+='${JVCS_PROMPT_SEGMENT}'
-# ----------------------------------------------------- #
-```
-
-After saving, reload your terminal, or run:
-
-```bash
-source ~/.zshrc
-```
-
----
-
-## Notes
-
-* `JVCS_VIEW` controls the view level displayed in the prompt.
-* `JVCS_PREFIX / SPLIT / SUFFIX` are used to customize the appearance.
-* `JVCS_PROMPT_SEGMENT` is only responsible for displaying the status and does not execute any logic.
-
-No further configuration is required.
diff --git a/scripts/deploy/legacy_zsh_support/install.sh b/scripts/deploy/legacy_zsh_support/install.sh
deleted file mode 100755
index aa92952..0000000
--- a/scripts/deploy/legacy_zsh_support/install.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/zsh
-cd "$(dirname "$0")"
-cp jvcs.plugin.zsh ~/.oh-my-zsh/custom/plugins/jvcs/jvcs.plugin.zsh
diff --git a/scripts/deploy/legacy_zsh_support/jvcs.plugin.zsh b/scripts/deploy/legacy_zsh_support/jvcs.plugin.zsh
deleted file mode 100644
index ff3f213..0000000
--- a/scripts/deploy/legacy_zsh_support/jvcs.plugin.zsh
+++ /dev/null
@@ -1,156 +0,0 @@
-# ████████ ████████
-# ██▒▒▒▒▒▒▒▒██ ██▒▒▒▒▒▒▒▒██
-# ██ ▒▒██ ██▒▒ ██ █████ ██ ██ ██████ █████
-# ██ ▒▒████████▒▒ ██ ▒▒▒██ ██ ██ ██████ ██████
-# ██ ▒▒▒▒▒▒▒▒ ██ ██ ██ ██ ███▒▒▒█ █▒▒▒▒█
-# ██ ██ ██ ██ ██ ███ ▒ ████ ▒
-# ██ ██ ██ ██ ██ ███ ▒████
-# ██ ████ ████ ██ ██ ▒██ ██▒ ███ ▒▒▒██
-# ██ ████ ████ ██ █ ██ ██ ██ ███ █ ██ ██
-# ██ ████ ████ ██ █ ██ ▒████▒ ▒██████ ██████
-# ██ ▒▒▒▒ ▒▒▒▒ █ ██ ▒████ ▒██▒ ██████ ▒████▒
-# ██ ██ ██ ▒▒▒▒ ▒▒ ▒▒▒▒▒▒ ▒▒▒▒
-# ██ ██████████ ██
-# ██ ██ JustEnoughVCS CommandLine
-# ████████████████████████████████ Zsh Plugin
-# ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
-
-autoload -Uz add-zsh-hook
-
-##################
-### APPEARANCE ###
-##################
-
-JVCS_VIEW='NORMAL'
-JVCS_PREFIX='['
-JVCS_SPLIT='/'
-JVCS_SUFFIX=']'
-
-###################
-### THEME READS ###
-###################
-
-JVCS_PROMPT_SEGMENT=''
-
-######################
-### INTERNAL STATE ###
-######################
-
-JVCS_DISPLAY=''
-JVCS_WS=''
-JVCS_ACCOUNT=''
-JVCS_SHEET=''
-JVCS_UPSTREAM=''
-
-###################
-### STATE LAYER ###
-###################
-
-jvcs_read_state() {
- if command -v jv &>/dev/null; then
- JVCS_WS="$(jv _workspace_dir 2>/dev/null)"
- JVCS_ACCOUNT="$(jv _account 2>/dev/null)"
- JVCS_SHEET="$(jv _sheet 2>/dev/null)"
- JVCS_UPSTREAM="$(jv _upstream 2>/dev/null)"
- else
- JVCS_WS=''
- JVCS_ACCOUNT=''
- JVCS_SHEET=''
- JVCS_UPSTREAM=''
- fi
-}
-
-##################
-### VIEW LAYER ###
-##################
-
-jvcs_compute_view() {
- # Must be in a Workspace, otherwise do not display
- if [[ -z "$JVCS_WS" ]]; then
- JVCS_DISPLAY=''
- return
- fi
- JVCS_DISPLAY='1'
-}
-
-####################
-### RENDER LAYER ###
-####################
-
-jvcs_render_prompt() {
- # Only set prompt segment if display is enabled
- if [[ -n "$JVCS_DISPLAY" ]]; then
- case "$JVCS_VIEW" in
- FULL)
- JVCS_PROMPT_SEGMENT="%{$fg[white]%}${JVCS_PREFIX}${JVCS_UPSTREAM}${JVCS_SPLIT}${JVCS_ACCOUNT}${JVCS_SPLIT}${JVCS_SHEET}${JVCS_SUFFIX} %{$reset_color%}"
- ;;
- NORMAL)
- JVCS_PROMPT_SEGMENT="%{$fg[white]%}${JVCS_PREFIX}${JVCS_ACCOUNT}${JVCS_SPLIT}${JVCS_SHEET}${JVCS_SUFFIX} %{$reset_color%}"
- ;;
- SHORT)
- JVCS_PROMPT_SEGMENT="%{$fg[white]%}${JVCS_PREFIX}${JVCS_SHEET}${JVCS_SUFFIX} %{$reset_color%}"
- ;;
- *)
- JVCS_PROMPT_SEGMENT=''
- ;;
- esac
- else
- JVCS_PROMPT_SEGMENT=''
- fi
-}
-
-####################
-### ORCHESTRATOR ###
-####################
-
-jvcs_update() {
- jvcs_read_state
- jvcs_compute_view
- jvcs_render_prompt
-}
-
-#############
-### HOOKS ###
-#############
-
-JVCS_NEED_REFRESH=0
-
-jvcs_preexec() {
- case "$1" in
- jv\ status | \
- jv\ use* | \
- jv\ as* | \
- jv\ exit | \
- jv\ sheet\ use* | \
- jv\ sheet\ sheet\ exit | \
- jv\ account\ as*)
- JVCS_NEED_REFRESH=1
- ;;
- esac
-}
-
-jvcs_precmd() {
- [[ "$JVCS_NEED_REFRESH" -eq 1 ]] || return
- JVCS_NEED_REFRESH=0
- jvcs_update
-}
-
-jvcs_chpwd() {
- jvcs_update
-}
-
-add-zsh-hook preexec jvcs_preexec
-add-zsh-hook precmd jvcs_precmd
-add-zsh-hook chpwd jvcs_chpwd
-
-###############################
-### FALLBACK INITIALIZATION ###
-###############################
-
-jvcs_precmd_init() {
- [[ -n "${JVCS_INITIALIZED:-}" ]] && return
- JVCS_INITIALIZED=1
- jvcs_update
-}
-
-add-zsh-hook precmd jvcs_precmd_init
diff --git a/scripts/make_lnk.ps1 b/scripts/make_lnk.ps1
deleted file mode 100644
index 2939cf3..0000000
--- a/scripts/make_lnk.ps1
+++ /dev/null
@@ -1,27 +0,0 @@
-$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
-$originalLocation = Get-Location
-Set-Location $scriptDir
-
-$deployPs1 = Join-Path $scriptDir "dev\deploy.ps1"
-$devDeployPs1 = Join-Path $scriptDir "dev\dev_deploy.ps1"
-$parentDir = Split-Path $scriptDir -Parent
-
-if (Test-Path $deployPs1) {
- $linkPath = Join-Path $parentDir "deploy.lnk"
- if (Test-Path $linkPath) { Remove-Item $linkPath -Force }
- $WshShell = New-Object -ComObject WScript.Shell
- $shortcut = $WshShell.CreateShortcut($linkPath)
- $shortcut.TargetPath = $deployPs1
- $shortcut.Save()
-}
-
-if (Test-Path $devDeployPs1) {
- $linkPath = Join-Path $parentDir "dev.lnk"
- if (Test-Path $linkPath) { Remove-Item $linkPath -Force }
- $WshShell = New-Object -ComObject WScript.Shell
- $shortcut = $WshShell.CreateShortcut($linkPath)
- $shortcut.TargetPath = $devDeployPs1
- $shortcut.Save()
-}
-
-Set-Location $originalLocation
diff --git a/scripts/make_lnk.sh b/scripts/make_lnk.sh
deleted file mode 100644
index 81a7dd5..0000000
--- a/scripts/make_lnk.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/bash
-script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-original_dir="$(pwd)"
-cd "$(dirname "$0")" || exit 1
-deploy_sh="$script_dir/dev/deploy.sh"
-dev_deploy_sh="$script_dir/dev/dev_deploy.sh"
-parent_dir="$(dirname "$script_dir")"
-
-if [ -f "$deploy_sh" ]; then
- link_path="$parent_dir/deploy"
- if [ -e "$link_path" ]; then
- rm -f "$link_path"
- fi
- ln -s "$deploy_sh" "$link_path"
-fi
-
-if [ -f "$dev_deploy_sh" ]; then
- link_path="$parent_dir/dev"
- if [ -e "$link_path" ]; then
- rm -f "$link_path"
- fi
- ln -s "$dev_deploy_sh" "$link_path"
-fi
-
-cd "$original_dir" || exit 1
diff --git a/scripts/setup/linux/inst.sh b/scripts/setup/linux/inst.sh
deleted file mode 100644
index ec609fc..0000000
--- a/scripts/setup/linux/inst.sh
+++ /dev/null
@@ -1,88 +0,0 @@
-# Check if required tools are installed
-echo "Checking for required tools..."
-if ! command -v cargo &> /dev/null; then
- echo "Error: cargo is not installed. Please install Rust and Cargo first."
- exit 1
-fi
-if ! command -v git &> /dev/null; then
- echo "Error: git is not installed. Please install git first."
- exit 1
-fi
-
-# Set installation directory to current directory
-echo "Installation directory set to current directory: $(pwd)"
-install_dir="$(pwd)"
-
-# Clone or update repos
-echo "Cloning or updating repositories..."
-mkdir -p "$install_dir"
-cd "$install_dir"
-
-# Function to clone or pull repository
-clone_or_pull() {
- local repo_url="$1"
- local repo_name=$(basename "$repo_url")
-
- if [ -d "$repo_name" ]; then
- echo "Repository $repo_name already exists, pulling latest changes..."
- cd "$repo_name"
- git pull origin main
- cd ..
- else
- echo "Cloning $repo_name..."
- git clone "$repo_url"
- fi
-}
-
-# Clone or update repositories
-clone_or_pull https://github.com/JustEnoughVCS/CommandLine
-clone_or_pull https://github.com/JustEnoughVCS/VersionControl
-
-# Setup VersionControl repo
-echo "Setting up VersionControl..."
-cd VersionControl
-chmod +x setup.sh
-./setup.sh
-
-# Build CLI
-echo "Building CLI..."
-cd ../CommandLine
-chmod +x deploy.sh
-./scripts/dev/deploy.sh
-
-# Configure shell to include CLI in PATH
-echo "Now adding JustEnoughVCS CLI to your environment. Please select your target shell:"
-echo "1) ~/.zshrc (Zsh)"
-echo "2) ~/.bashrc (Bash)"
-echo "3) ~/.config/fish/config.fish (Fish)"
-echo "4) Skip shell configuration"
-echo -n "Enter your choice (1-4): "
-read choice
-
-case $choice in
- 1)
- config_file="$HOME/.zshrc"
- ;;
- 2)
- config_file="$HOME/.bashrc"
- ;;
- 3)
- config_file="$HOME/.config/fish/config.fish"
- ;;
- 4)
- echo "Skipping shell configuration."
- echo "Installation completed! You can manually add the CLI to your PATH later."
- exit 0
- ;;
- *)
- echo "Invalid choice. Skipping shell configuration."
- exit 0
- ;;
-esac
-
-cli_path="$(pwd)/export/jv_cli.sh"
-echo "# JustEnoughVCS CLI" >> "$config_file"
-echo "source \"$cli_path\"" >> "$config_file"
-echo "CLI has been added to $config_file"
-echo "Please restart your shell or run: source $config_file"
-echo "Installation completed successfully!"
diff --git a/scripts/setup/windows/inst.ps1 b/scripts/setup/windows/post_inst.ps1
index 4cb4772..4cb4772 100644
--- a/scripts/setup/windows/inst.ps1
+++ b/scripts/setup/windows/post_inst.ps1
diff --git a/scripts/setup/windows/uninst.ps1 b/scripts/setup/windows/post_uninst.ps1
index d5c898d..d5c898d 100644
--- a/scripts/setup/windows/uninst.ps1
+++ b/scripts/setup/windows/post_uninst.ps1