Scripts

better-shell

Moderniza ambientes de terminal com ferramentas e configurações profissionais.

Como usar (Bash)

  1. 1.Baixe o script para a pasta do seu projeto (mesmo diretório do package.json)
  2. 2.Torne-o executável: chmod +x {scriptPath}
  3. 3.Execute: ./{scriptPath}
1#!/usr/bin/env bash
2# Install better-shell from GitHub releases
3
4set -e
5
6# Colors
7RED='\033[0;31m'
8GREEN='\033[0;32m'
9BLUE='\033[0;34m'
10NC='\033[0m' # No Color
11
12echo -e "${BLUE}🚀 better-shell installer${NC}"
13echo ""
14
15# Detect OS
16OS=$(uname -s | tr '[:upper:]' '[:lower:]')
17case "$OS" in
18  darwin) OS="darwin" ;;
19  linux) OS="linux" ;;
20  *)
21    echo -e "${RED}❌ Unsupported OS: $OS${NC}"
22    echo "better-terminal supports macOS and Linux only"
23    exit 1
24    ;;
25esac
26
27# Detect architecture
28ARCH=$(uname -m)
29case "$ARCH" in
30  x86_64) ARCH="x64" ;;
31  aarch64|arm64) ARCH="arm64" ;;
32  *)
33    echo -e "${RED}❌ Unsupported architecture: $ARCH${NC}"
34    exit 1
35    ;;
36esac
37
38echo -e "Platform: ${GREEN}$OS-$ARCH${NC}"
39
40# Get latest release info
41REPO="ocodista/better-shell"
42RELEASE_URL="https://api.github.com/repos/$REPO/releases/latest"
43
44echo "Fetching latest release..."
45RELEASE_DATA=$(curl -sL "$RELEASE_URL")
46
47# Extract version
48VERSION=$(echo "$RELEASE_DATA" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
49if [ -z "$VERSION" ]; then
50  echo -e "${RED}❌ Failed to fetch latest release${NC}"
51  echo "Check: https://github.com/$REPO/releases"
52  exit 1
53fi
54
55echo -e "Latest version: ${GREEN}$VERSION${NC}"
56
57# Construct download URL
58if [ "$OS" = "darwin" ]; then
59  BINARY_NAME="better-shell-darwin-$ARCH"
60else
61  BINARY_NAME="better-shell-linux-$ARCH"
62fi
63
64DOWNLOAD_URL="https://github.com/$REPO/releases/download/$VERSION/$BINARY_NAME"
65
66# Download binary
67TMP_DIR=$(mktemp -d)
68TMP_FILE="$TMP_DIR/better-shell"
69
70echo "Downloading..."
71if ! curl -fsSL "$DOWNLOAD_URL" -o "$TMP_FILE"; then
72  echo -e "${RED}❌ Download failed${NC}"
73  echo "URL: $DOWNLOAD_URL"
74  exit 1
75fi
76
77# Make executable
78chmod +x "$TMP_FILE"
79
80echo -e "${GREEN}${NC} Downloaded successfully"
81echo ""
82
83# Run installation
84echo "Starting installation..."
85echo ""
86"$TMP_FILE" install
87
88# Cleanup
89rm -rf "$TMP_DIR"
90
91echo ""
92echo -e "${GREEN}✨ Installation complete!${NC}"
93echo ""
94echo "Next steps:"
95echo "1. Restart your terminal or run: exec zsh"
96echo "2. Press 'prefix + I' in tmux to install plugins"
97echo "3. Set terminal font to FiraCode Nerd Font"
98