futrou 2.0.17 → 2.0.19

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.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ![Futrou CLI Banner](.github/assets/banner.png)
1
+ ![Futrou CLI Banner](.github/assets/banner.jpg)
2
2
 
3
3
  # Futrou CLI
4
4
 
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/install.ps1 CHANGED
@@ -56,44 +56,52 @@ $Exe = "$BinDir\futrou.exe"
56
56
  $null = New-Item -ItemType Directory -Force -Path $BinDir
57
57
 
58
58
  # ---------------------------------------------------------------------------
59
- # Detect existing installation
59
+ # Detect existing installation and decide action label
60
60
  # ---------------------------------------------------------------------------
61
+ $Action = "Installing"
61
62
  $CurrentVersion = $null
63
+
62
64
  if (Test-Path $Exe) {
63
65
  try {
64
- $raw = & $Exe --version 2>$null
66
+ $raw = & $Exe version 2>$null
65
67
  if ($raw -match '(\d+\.\d+\.\d+)') { $CurrentVersion = $Matches[1] }
66
68
  } catch { }
67
69
  }
68
70
 
71
+ if ($CurrentVersion -and $Version -ne "latest") {
72
+ $TargetVersion = $Version.TrimStart('v')
73
+ if ($CurrentVersion -eq $TargetVersion) {
74
+ Write-Info "Futrou CLI v$CurrentVersion is already installed at $Exe"
75
+ exit 0
76
+ }
77
+ $cur = [Version]$CurrentVersion
78
+ $tgt = [Version]$TargetVersion
79
+ $Action = if ($tgt -gt $cur) { "Upgrading" } elseif ($tgt -lt $cur) { "Downgrading" } else { "Reinstalling" }
80
+ } elseif ($CurrentVersion) {
81
+ $Action = "Upgrading"
82
+ }
83
+
84
+ $DisplayVersion = if ($Version -eq "latest") { "latest" } else { $Version.TrimStart('v') }
85
+
86
+ $DisplayVersionLabel = if ($Version -eq "latest") { "latest" } else { "v$DisplayVersion" }
87
+
88
+ if ($CurrentVersion) {
89
+ Write-Info "$Action Futrou CLI v$CurrentVersion -> $DisplayVersionLabel"
90
+ } else {
91
+ Write-Info "Installing Futrou CLI $DisplayVersionLabel"
92
+ }
93
+
69
94
  # ---------------------------------------------------------------------------
70
- # Download with spinner
95
+ # Download
71
96
  # ---------------------------------------------------------------------------
72
97
  $TmpExe = "$BinDir\futrou-tmp.exe"
73
98
  Remove-Item -Force $TmpExe -ErrorAction SilentlyContinue
74
99
 
75
- # Spinner job
76
- $spinnerJob = $null
77
- if ([Environment]::UserInteractive -and -not [Console]::IsOutputRedirected) {
78
- $spinnerJob = Start-Job -ScriptBlock {
79
- $frames = '⠋','⠙','⠹','⠸','⠼','⠴','⠦','⠧','⠇','⠏'
80
- $i = 0
81
- while ($true) {
82
- $f = $frames[$i % $frames.Count]
83
- [Console]::Write("`r$f Checking versions...")
84
- Start-Sleep -Milliseconds 80
85
- $i++
86
- }
87
- }
88
- } else {
89
- Write-Info "Checking versions..."
90
- }
91
-
92
100
  $downloaded = $false
93
101
 
94
102
  if (-not $DownloadWithoutCurl) {
95
103
  try {
96
- curl.exe "-#SfLo" $TmpExe $URL 2>$null
104
+ curl.exe "-#SfLo" $TmpExe $URL
97
105
  if ($LASTEXITCODE -eq 0) { $downloaded = $true }
98
106
  } catch { }
99
107
  }
@@ -102,21 +110,12 @@ if (-not $downloaded) {
102
110
  try {
103
111
  Invoke-RestMethod -Uri $URL -OutFile $TmpExe
104
112
  $downloaded = $true
105
- } catch { }
106
- }
107
-
108
- # Stop spinner
109
- if ($spinnerJob) {
110
- Stop-Job $spinnerJob -ErrorAction SilentlyContinue
111
- Remove-Job $spinnerJob -ErrorAction SilentlyContinue
112
- [Console]::Write("`r" + (" " * 40) + "`r")
113
- }
114
-
115
- if (-not $downloaded) {
116
- if ($Version -eq "latest") {
117
- Write-Fail "Failed to download latest release. Try again later.`n $URL"
118
- } else {
119
- Write-Fail "Version $Version not found or binary not available for $Target.`n $URL"
113
+ } catch {
114
+ if ($Version -eq "latest") {
115
+ Write-Fail "Failed to download latest release. Try again later.`n $URL"
116
+ } else {
117
+ Write-Fail "Version $Version not found or binary not available for $Target.`n $URL"
118
+ }
120
119
  }
121
120
  }
122
121
 
@@ -124,38 +123,6 @@ if (-not (Test-Path $TmpExe)) {
124
123
  Write-Fail "Download produced no file. Did antivirus delete it?"
125
124
  }
126
125
 
127
- # ---------------------------------------------------------------------------
128
- # Check new version before replacing
129
- # ---------------------------------------------------------------------------
130
- $NewVersion = $null
131
- try {
132
- $raw = & $TmpExe --version 2>$null
133
- if ($raw -match '(\d+\.\d+\.\d+)') { $NewVersion = $Matches[1] }
134
- } catch { }
135
-
136
- # Already up to date?
137
- if ($CurrentVersion -and $NewVersion -eq $CurrentVersion) {
138
- Remove-Item -Force $TmpExe -ErrorAction SilentlyContinue
139
- Write-Success "Futrou CLI is already the latest version v$CurrentVersion."
140
- exit 0
141
- }
142
-
143
- # Decide action
144
- $Action = "Installing"
145
- if ($CurrentVersion -and $NewVersion) {
146
- $cur = [Version]$CurrentVersion
147
- $nw = [Version]$NewVersion
148
- $Action = if ($nw -gt $cur) { "Upgrading" } elseif ($nw -lt $cur) { "Downgrading" } else { "Installing" }
149
- } elseif ($CurrentVersion) {
150
- $Action = "Upgrading"
151
- }
152
-
153
- if ($CurrentVersion -and $Action -ne "Installing") {
154
- Write-Info "$Action Futrou CLI v$CurrentVersion → v$NewVersion"
155
- } else {
156
- Write-Info "Installing Futrou CLI v$NewVersion"
157
- }
158
-
159
126
  try { Remove-Item -Force $Exe -ErrorAction SilentlyContinue } catch { }
160
127
  Move-Item -Force $TmpExe $Exe
161
128
 
@@ -164,7 +131,7 @@ Move-Item -Force $TmpExe $Exe
164
131
  # ---------------------------------------------------------------------------
165
132
  $InstalledVersion = $null
166
133
  try {
167
- $raw = & $Exe --version 2>$null
134
+ $raw = & $Exe version 2>$null
168
135
  if ($raw -match '(\d+\.\d+\.\d+)') { $InstalledVersion = $Matches[1] }
169
136
  } catch { }
170
137
 
@@ -173,16 +140,13 @@ if (-not $InstalledVersion) {
173
140
  }
174
141
 
175
142
  $ActionPast = switch ($Action) {
143
+ "Installing" { "installed" }
176
144
  "Upgrading" { "upgraded" }
177
145
  "Downgrading" { "downgraded" }
178
146
  default { "installed" }
179
147
  }
180
148
 
181
- if ($CurrentVersion -and $Action -ne "Installing") {
182
- Write-Success "Futrou CLI v$CurrentVersion $ActionPast v$InstalledVersion"
183
- } else {
184
- Write-Success "Futrou CLI v$InstalledVersion $ActionPast"
185
- }
149
+ Write-Success "Futrou CLI v$InstalledVersion was $ActionPast to $Exe"
186
150
 
187
151
  # ---------------------------------------------------------------------------
188
152
  # PATH update
@@ -219,10 +183,15 @@ if (-not $NoPathUpdate) {
219
183
  if ($CurrentPath -notcontains $BinDir) {
220
184
  $NewPath = ($CurrentPath + $BinDir) -join ';'
221
185
  Set-UserPath $NewPath
222
- $env:PATH = "$BinDir;$env:PATH"
186
+ $env:PATH = $env:PATH + ";$BinDir"
223
187
  Write-Info "Added $BinDir to your PATH"
224
- Write-Output ""
225
- Write-Info "Reload your shell to use futrou:"
226
- Write-Info " Open a new PowerShell window and run: futrou --help"
227
188
  }
228
189
  }
190
+
191
+ # Make futrou available in the current session without restarting
192
+ if ($env:PATH -notlike "*$BinDir*") {
193
+ $env:PATH = "$BinDir;$env:PATH"
194
+ }
195
+
196
+ Write-Output ""
197
+ Write-Output "To get started, run: futrou --help"
package/install.sh CHANGED
@@ -107,7 +107,7 @@ tildify() {
107
107
  # ---------------------------------------------------------------------------
108
108
  current_version=""
109
109
  if [[ -x "$exe" ]]; then
110
- current_version=$("$exe" --version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1 || true)
110
+ current_version=$("$exe" version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1 || true)
111
111
  fi
112
112
 
113
113
  # ---------------------------------------------------------------------------
@@ -164,7 +164,7 @@ if [[ -n "$spinner_pid" ]]; then
164
164
  fi
165
165
 
166
166
  # Read new version from downloaded binary
167
- new_version=$("$tmp_exe" --version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1 || true)
167
+ new_version=$("$tmp_exe" version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1 || true)
168
168
 
169
169
  # Already up to date?
170
170
  if [[ -n "$current_version" && "$new_version" == "$current_version" ]]; then
@@ -200,7 +200,7 @@ mv -f "$tmp_exe" "$exe"
200
200
  # ---------------------------------------------------------------------------
201
201
  # Verify
202
202
  # ---------------------------------------------------------------------------
203
- installed_version=$("$exe" --version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1 || true)
203
+ installed_version=$("$exe" version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1 || true)
204
204
  [[ -z $installed_version ]] && error "Downloaded binary failed to run"
205
205
 
206
206
  case $action in
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "futrou",
3
3
  "productName": "Futrou CLI",
4
- "version": "2.0.17",
4
+ "version": "2.0.19",
5
5
  "description": "Futrou CLI - Deploy and manage Futrou Cloud from your terminal.",
6
6
  "main": "./index.cjs",
7
7
  "types": "./index.d.ts",