@wevion/cli 1.0.3209 → 1.0.3219

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wevion/cli",
3
- "version": "1.0.3209",
3
+ "version": "1.0.3219",
4
4
  "description": "Wevion API command-line interface — generated from the public OpenAPI spec",
5
5
  "type": "module",
6
6
  "bin": {
package/selftest.mjs CHANGED
@@ -402,7 +402,7 @@ assert.ok(compareVersions('1.0.0-beta.1', '1.0.0') < 0)
402
402
  assert.ok(compareVersions('1.0.0', '1.0.0-beta.1') > 0)
403
403
  assert.ok(isSafeVersion('1.0.0-beta.1'))
404
404
  assert.equal(isSafeVersion('1.0.0\nbad'), false)
405
- assert.equal(updateCheckPath({ XDG_CONFIG_HOME: '/x' }), '/x/wevion/update-check.json')
405
+ assert.equal(updateCheckPath({ XDG_CONFIG_HOME: '/x' }, 'linux'), '/x/wevion/update-check.json')
406
406
  assert.deepEqual(updateCheckEnv({ HOME: '/h', WEVION_API_KEY: 'secret', HTTPS_PROXY: 'http://p' }), {
407
407
  HOME: '/h',
408
408
  HTTPS_PROXY: 'http://p',
package/src/index.mjs CHANGED
@@ -22,7 +22,7 @@ import {
22
22
  import { homedir } from 'node:os'
23
23
  import { createInterface } from 'node:readline/promises'
24
24
  import { fileURLToPath } from 'node:url'
25
- import { dirname, join } from 'node:path'
25
+ import { dirname, join, posix } from 'node:path'
26
26
  import { spawn } from 'node:child_process'
27
27
 
28
28
  const HTTP_METHODS = ['get', 'post', 'put', 'patch', 'delete']
@@ -39,8 +39,8 @@ export function configPath(env = process.env, platform = process.platform) {
39
39
  const base = env.APPDATA || join(env.USERPROFILE || env.HOME || homedir(), 'AppData', 'Roaming')
40
40
  return join(base, 'Wevion', 'config.json')
41
41
  }
42
- const base = env.XDG_CONFIG_HOME || join(env.HOME || homedir(), '.config')
43
- return join(base, 'wevion', 'config.json')
42
+ const base = env.XDG_CONFIG_HOME || posix.join(env.HOME || homedir(), '.config')
43
+ return posix.join(base, 'wevion', 'config.json')
44
44
  }
45
45
 
46
46
  function readConfig() {
@@ -178,7 +178,8 @@ function pkgInfo() {
178
178
  }
179
179
 
180
180
  export function updateCheckPath(env = process.env, platform = process.platform) {
181
- return join(dirname(configPath(env, platform)), 'update-check.json')
181
+ const p = platform === 'win32' ? { dirname, join } : { dirname: posix.dirname, join: posix.join }
182
+ return p.join(p.dirname(configPath(env, platform)), 'update-check.json')
182
183
  }
183
184
 
184
185
  function parseSemver(v) {