openmux 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bin/openmux +30 -11
  2. package/package.json +4 -2
package/bin/openmux CHANGED
@@ -75,6 +75,17 @@ get_platform() {
75
75
  echo "${os}-${arch}"
76
76
  }
77
77
 
78
+ spinner() {
79
+ local pid=$1
80
+ local spin='⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏'
81
+ local i=0
82
+ while kill -0 "$pid" 2>/dev/null; do
83
+ printf "\r %s %s" "${spin:i++%${#spin}:1}" "$2"
84
+ sleep 0.1
85
+ done
86
+ printf "\r"
87
+ }
88
+
78
89
  download_binary() {
79
90
  local package_dir="$1"
80
91
  local dist_dir="$package_dir/dist"
@@ -93,33 +104,41 @@ download_binary() {
93
104
 
94
105
  local url="https://github.com/$REPO/releases/download/$version/openmux-$version-$platform.tar.gz"
95
106
 
96
- echo "Downloading openmux $version for $platform..."
97
- echo "From: $url"
107
+ printf "\n"
108
+ printf " \033[1mopenmux\033[0m %s\n" "$version"
109
+ printf " Setting up for first run...\n"
110
+ printf "\n"
98
111
 
99
112
  mkdir -p "$dist_dir"
100
113
  local tmp_file="$dist_dir/download.tar.gz"
101
114
 
102
- # Download
115
+ # Download with spinner
103
116
  if command -v curl &>/dev/null; then
104
- curl -fsSL "$url" -o "$tmp_file" || return 1
117
+ curl -fsSL "$url" -o "$tmp_file" 2>/dev/null &
105
118
  elif command -v wget &>/dev/null; then
106
- wget -q "$url" -O "$tmp_file" || return 1
119
+ wget -q "$url" -O "$tmp_file" 2>/dev/null &
107
120
  else
108
121
  echo "Error: curl or wget required" >&2
109
122
  return 1
110
123
  fi
111
-
112
- # Extract
113
- echo "Extracting..."
114
- tar -xzf "$tmp_file" -C "$dist_dir"
124
+ spinner $! "Downloading..."
125
+ wait $! || { printf " \033[31mDownload failed\033[0m\n"; return 1; }
126
+ printf " \033[32m✓\033[0m Downloaded\n"
127
+
128
+ # Extract with spinner
129
+ tar -xzf "$tmp_file" -C "$dist_dir" &
130
+ spinner $! "Extracting..."
131
+ wait $!
115
132
  rm -f "$tmp_file"
133
+ printf " \033[32m✓\033[0m Extracted\n"
116
134
 
117
135
  # Make executable
118
136
  chmod +x "$dist_dir/openmux-bin" 2>/dev/null || true
119
137
  chmod +x "$dist_dir/openmux" 2>/dev/null || true
120
138
 
121
- echo "Ready!"
122
- echo ""
139
+ printf "\n"
140
+ printf " \033[32mReady!\033[0m Starting openmux...\n"
141
+ printf "\n"
123
142
  }
124
143
 
125
144
  PACKAGE_DIR="$(find_package_dir)"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openmux",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Terminal multiplexer with master-stack tiling layout",
5
5
  "module": "src/index.tsx",
6
6
  "type": "module",
@@ -9,7 +9,9 @@
9
9
  },
10
10
  "files": [
11
11
  "bin",
12
- "scripts/postinstall.cjs"
12
+ "scripts/postinstall.cjs",
13
+ "README.md",
14
+ "LICENSE"
13
15
  ],
14
16
  "scripts": {
15
17
  "start": "bun run src/index.tsx",