@putdotio/cli 1.2.2 → 1.2.3
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/dist/bin.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { A as CliSdkLive, B as translate, F as renderJson, I as writeOutput, L as CliConfigLive, M as CliOutputLive, N as detectOutputModeFromArgv, P as isStructuredOutputMode, R as CliRuntime, V as version, a as searchCommand, c as brandCommand, d as getOption, f as outputOption, i as filesCommand, j as CliOutput, l as versionCommand, n as whoamiCommand, o as eventsCommand, r as transfersCommand, s as downloadLinksCommand, t as describeCli, u as makeAuthCommand, v as CliStateLive, z as CliRuntimeLive } from "./metadata-
|
|
2
|
+
import { A as CliSdkLive, B as translate, F as renderJson, I as writeOutput, L as CliConfigLive, M as CliOutputLive, N as detectOutputModeFromArgv, P as isStructuredOutputMode, R as CliRuntime, V as version, a as searchCommand, c as brandCommand, d as getOption, f as outputOption, i as filesCommand, j as CliOutput, l as versionCommand, n as whoamiCommand, o as eventsCommand, r as transfersCommand, s as downloadLinksCommand, t as describeCli, u as makeAuthCommand, v as CliStateLive, z as CliRuntimeLive } from "./metadata-CSXfRQuw.mjs";
|
|
3
3
|
import { Cause, Console, Effect, Layer, Result } from "effect";
|
|
4
4
|
import { CliError, Command } from "effect/unstable/cli";
|
|
5
5
|
import { NodeRuntime, NodeServices } from "@effect/platform-node";
|
|
@@ -107,13 +107,24 @@ const executableName = (value) => {
|
|
|
107
107
|
const normalized = value.replaceAll("\\", "/");
|
|
108
108
|
return normalized.slice(normalized.lastIndexOf("/") + 1).toLowerCase();
|
|
109
109
|
};
|
|
110
|
+
const isNodeExecutable = (value) => {
|
|
111
|
+
const name = executableName(value);
|
|
112
|
+
return name === "node" || name === "node.exe";
|
|
113
|
+
};
|
|
114
|
+
const isPutioExecutable = (value) => {
|
|
115
|
+
const name = executableName(value);
|
|
116
|
+
return name === "putio" || name === "putio.exe" || name === "bin.mjs";
|
|
117
|
+
};
|
|
118
|
+
const stripLeadingPutioExecutables = (args) => {
|
|
119
|
+
let start = 0;
|
|
120
|
+
while (isPutioExecutable(args[start] ?? "")) start++;
|
|
121
|
+
return args.slice(start);
|
|
122
|
+
};
|
|
110
123
|
const commandArgsFromArgv = (args) => {
|
|
111
124
|
const [first] = args;
|
|
112
125
|
if (first === void 0) return args;
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
if (firstName === "putio" || firstName === "putio.exe" || firstName === "bin.mjs") return args.slice(1);
|
|
116
|
-
return args;
|
|
126
|
+
if (isNodeExecutable(first)) return stripLeadingPutioExecutables(args.slice(2));
|
|
127
|
+
return stripLeadingPutioExecutables(args);
|
|
117
128
|
};
|
|
118
129
|
function runCli(args) {
|
|
119
130
|
const run = Command.runWith(command, { version });
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as getAuthStatus, D as resolveAuthState, E as removeProfile, O as savePersistedState, S as clearPersistedState, T as loadPersistedState, _ as CliState, b as PutioCliProfileConfigSchema, g as AuthStatusSchema, h as AuthStateError, k as useProfile, m as AuthProfileSummarySchema, p as AuthProfileListSchema, t as describeCli, v as CliStateLive, w as listProfiles, x as ResolvedAuthStateSchema, y as PutioCliConfigSchema } from "./metadata-
|
|
1
|
+
import { C as getAuthStatus, D as resolveAuthState, E as removeProfile, O as savePersistedState, S as clearPersistedState, T as loadPersistedState, _ as CliState, b as PutioCliProfileConfigSchema, g as AuthStatusSchema, h as AuthStateError, k as useProfile, m as AuthProfileSummarySchema, p as AuthProfileListSchema, t as describeCli, v as CliStateLive, w as listProfiles, x as ResolvedAuthStateSchema, y as PutioCliConfigSchema } from "./metadata-CSXfRQuw.mjs";
|
|
2
2
|
export { AuthProfileListSchema, AuthProfileSummarySchema, AuthStateError, AuthStatusSchema, CliState, CliStateLive, PutioCliConfigSchema, PutioCliProfileConfigSchema, ResolvedAuthStateSchema, clearPersistedState, describeCli, getAuthStatus, listProfiles, loadPersistedState, removeProfile, resolveAuthState, savePersistedState, useProfile };
|
|
@@ -13,7 +13,7 @@ import * as FileSystem from "effect/FileSystem";
|
|
|
13
13
|
import { PlatformError, SystemError } from "effect/PlatformError";
|
|
14
14
|
//#region package.json
|
|
15
15
|
var name = "@putdotio/cli";
|
|
16
|
-
var version = "1.2.
|
|
16
|
+
var version = "1.2.3";
|
|
17
17
|
//#endregion
|
|
18
18
|
//#region src/i18n/translate.ts
|
|
19
19
|
const resources = { en: { translation: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putdotio/cli",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"description": "Agent-first CLI for the put.io API.",
|
|
5
5
|
"homepage": "https://github.com/putdotio/putio-cli#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"check": "vp check .",
|
|
35
35
|
"coverage": "vp test --coverage",
|
|
36
36
|
"dev": "vp pack --watch",
|
|
37
|
-
"prepare": "./scripts/prepare-effect.
|
|
37
|
+
"prepare": "node ./scripts/prepare-effect.mts",
|
|
38
38
|
"prepack": "vp pack",
|
|
39
39
|
"smoke:pack": "node ./scripts/smoke-packed-install.mts",
|
|
40
40
|
"test": "vp test",
|