diff --git a/.gitignore b/.gitignore index 2142bdd9d..48a772f28 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ .DS_Store # Cli -sac-cli +sac # VSCode .vscode diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f935c8414..c5bbfbdd0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -131,7 +131,7 @@ ### SAC CLI - To install use `./install.sh` and then run `sac-cli` to see all commands. + To install use `./install.sh` and then run `sac` to see all commands. # Git Flow diff --git a/cli/main.go b/cli/main.go index 880a7598a..a81e5667b 100755 --- a/cli/main.go +++ b/cli/main.go @@ -10,7 +10,7 @@ import ( func main() { app := &cli.App{ - Name: "sac-cli", + Name: "sac", Usage: "CLI for the GenerateNU SAC", Commands: []*cli.Command{ commands.SwaggerCommand(), diff --git a/cli/utils/path.go b/cli/utils/path.go index 01b9a6a1a..7ff98bf94 100644 --- a/cli/utils/path.go +++ b/cli/utils/path.go @@ -13,7 +13,7 @@ func GetRootDir() (string, error) { return "", err } - // Find the closest directory containing "sac-cli" (the root directory) + // Find the closest directory containing "sac" (the root directory) rootDir, err := FindRootDir(currentDir) if err != nil { return "", err @@ -23,19 +23,19 @@ func GetRootDir() (string, error) { } func FindRootDir(dir string) (string, error) { - // Check if "sac-cli" exists in the current directory - mainGoPath := filepath.Join(dir, "sac-cli") + // Check if "sac" exists in the current directory + mainGoPath := filepath.Join(dir, "sac") _, err := os.Stat(mainGoPath) if err == nil { - // "sac-cli" found, this is the root directory + // "sac" found, this is the root directory return dir, nil } // If not found, go up one level parentDir := filepath.Dir(dir) if parentDir == dir { - // Reached the top without finding "sac-cli" - return "", fmt.Errorf("could not find root directory containing sac-cli") + // Reached the top without finding "sac" + return "", fmt.Errorf("could not find root directory containing sac") } // Recursively search in the parent directory diff --git a/install.ps1 b/install.ps1 index d7a8051eb..153e91c17 100644 --- a/install.ps1 +++ b/install.ps1 @@ -2,19 +2,19 @@ $ScriptPath = (Get-Item -Path $MyInvocation.MyCommand.Path).DirectoryName # Build the Go CLI tool -go build -o "sac-cli" "cli/main.go" +go build -o "sac" "cli/main.go" -# Check if sac-cli is already installed -if (Test-Path -Path "$Env:USERPROFILE\AppData\Local\Programs\sac-cli\sac-cli.exe") { +# Check if sac is already installed +if (Test-Path -Path "$Env:USERPROFILE\AppData\Local\Programs\sac\sac.exe") { exit 1 } -# Copy the sac-cli executable to a directory in the user's PATH -$InstallPath = "$Env:USERPROFILE\AppData\Local\Programs\sac-cli" +# Copy the sac executable to a directory in the user's PATH +$InstallPath = "$Env:USERPROFILE\AppData\Local\Programs\sac" if (-not (Test-Path -Path $InstallPath)) { New-Item -ItemType Directory -Path $InstallPath | Out-Null } -Copy-Item -Path "sac-cli" -Destination "$InstallPath\sac-cli.exe" -Force +Copy-Item -Path "sac" -Destination "$InstallPath\sac.exe" -Force # Add the installation path to the user's PATH $PathEnvVar = [System.Environment]::GetEnvironmentVariable("PATH", [System.EnvironmentVariableTarget]::User) @@ -23,4 +23,4 @@ if (-not ($PathEnvVar -like "*$InstallPath*")) { } # Inform the user -Write-Host "Installation complete. You can now run 'sac-cli' from anywhere." +Write-Host "Installation complete. You can now run 'sac' from anywhere." diff --git a/install.sh b/install.sh index 383916404..f797ee6a9 100755 --- a/install.sh +++ b/install.sh @@ -7,19 +7,19 @@ set -o pipefail SCRIPT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # Build the Go CLI tool -go build -o "sac-cli" "cli/main.go" +go build -o "sac" "cli/main.go" # Identify the user's shell SHELL_NAME=$(basename "$SHELL") # Check if the command is already installed to avoid adding it to path multiple times -COMMAND_NAME="sac-cli" +COMMAND_NAME="sac" if command -v "$COMMAND_NAME" >/dev/null 2>&1; then exit 1 fi -# Add sac-cli to the user's PATH +# Add sac to the user's PATH if [[ $SHELL_NAME == "zsh" ]]; then echo "export PATH=\"$SCRIPT_PATH:\$PATH\"" >>~/.zshrc source ~/.zshrc @@ -32,4 +32,4 @@ else fi # Inform the user -echo "Installation complete. You can now run 'sac-cli' from anywhere." +echo "Installation complete. You can now run 'sac' from anywhere."