puter-cli 1.6.0 → 1.6.1

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/CHANGELOG.md CHANGED
@@ -4,8 +4,14 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ #### [v1.6.1](https://github.com/HeyPuter/puter-cli/compare/v1.6.0...v1.6.1)
8
+
9
+ - fix: set subdomain when creating a site [`6329ed1`](https://github.com/HeyPuter/puter-cli/commit/6329ed1c766b8eb722ac8c03c9ffe61dbba4a66c)
10
+
7
11
  #### [v1.6.0](https://github.com/HeyPuter/puter-cli/compare/v1.5.7...v1.6.0)
8
12
 
13
+ > 16 February 2025
14
+
9
15
  - feat: improve init command [`2bd51ee`](https://github.com/HeyPuter/puter-cli/commit/2bd51ee01d0636b7979a9f55d3c746287c3b512a)
10
16
  - chore: improve error message [`46fb3b0`](https://github.com/HeyPuter/puter-cli/commit/46fb3b063c1c74d0006138cd400b6ad207e784d9)
11
17
  - chore: update package repo [`f6960ed`](https://github.com/HeyPuter/puter-cli/commit/f6960ed6f8e6fb793a6b8340476ab22778b44c14)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "puter-cli",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "Command line interface for Puter cloud platform",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -402,8 +402,8 @@ export async function deleteFolder(folderPath, skipConfirmation = false) {
402
402
  });
403
403
 
404
404
  const deleteData = await deleteResponse.json();
405
- if (deleteResponse.ok) {
406
- console.log(chalk.green(`Successfully deleted all contents of "${folderPath}"!`));
405
+ if (deleteResponse.ok && Object.keys(deleteData).length == 0) {
406
+ console.log(chalk.green(`Successfully deleted all contents from: ${chalk.cyan(folderPath)}`));
407
407
  } else {
408
408
  console.log(chalk.red('Failed to delete folder. Please check your input.'));
409
409
  }
@@ -192,12 +192,16 @@ export async function infoSite(args = []) {
192
192
  }
193
193
  }
194
194
  }
195
- } else {
196
- console.log(chalk.yellow(`The subdomain: "${subdomain}" is already taken, so let's generate a new random one:`));
197
- subdomain = generateAppName(); // Generate a random subdomain
198
- console.log(chalk.cyan(`New generated subdomain: "${subdomain}" will be used.`));
199
- }
200
-
195
+ }
196
+ // else {
197
+ // console.log(chalk.yellow(`The subdomain: "${subdomain}" is already taken, so let's generate a new random one:`));
198
+ // subdomain = generateAppName(); // Generate a random subdomain
199
+ // console.log(chalk.cyan(`New generated subdomain: "${subdomain}" will be used.`));
200
+ // }
201
+
202
+ // Use the chosen "subdomain"
203
+ console.log(chalk.cyan(`New generated subdomain: "${subdomain}" will be used if its not already in use.`));
204
+
201
205
  // Step 3: Host the current directory under the subdomain
202
206
  console.log(chalk.cyan(`Hosting app "${appName}" under subdomain "${subdomain}"...`));
203
207
  const site = await createSubdomain(subdomain, remoteDir);
@@ -93,6 +93,7 @@ export async function createSubdomain(subdomain, remoteDir) {
93
93
  const data = await response.json();
94
94
  if (!data.success || !data.result) {
95
95
  if (data.error?.code === 'already_in_use') {
96
+ // data.error?.status===409
96
97
  console.log(chalk.yellow(`Subdomain already taken!\nMessage: ${data?.error?.message}`));
97
98
  return false;
98
99
  }