kirby-deploy 0.2.0 → 0.3.2
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/cli.js +45 -20
- package/dist/index.d.ts +19 -17
- package/package.json +14 -10
- package/src/commands/accounts.ts +1 -1
- package/src/commands/content.ts +1 -1
- package/src/commands/languages.ts +1 -1
- package/src/commands/main.ts +5 -2
- package/src/config.ts +15 -3
- package/src/lftp/cat.ts +7 -2
- package/src/lftp/mirror.ts +1 -1
- package/src/sync.ts +1 -1
- package/src/types.ts +7 -1
- package/src/utils.ts +1 -1
package/dist/cli.js
CHANGED
|
@@ -5,7 +5,7 @@ import { runMain } from "citty";
|
|
|
5
5
|
|
|
6
6
|
// src/commands/main.ts
|
|
7
7
|
import { defineCommand as defineCommand4 } from "citty";
|
|
8
|
-
import consola9 from "consola";
|
|
8
|
+
import { consola as consola9 } from "consola";
|
|
9
9
|
import { colors as colors6 } from "consola/utils";
|
|
10
10
|
import { readFileSync } from "fs";
|
|
11
11
|
import { join as join6, relative } from "path/posix";
|
|
@@ -13,7 +13,7 @@ import { cwd as cwd2 } from "process";
|
|
|
13
13
|
|
|
14
14
|
// src/config.ts
|
|
15
15
|
import { loadConfig as load } from "c12";
|
|
16
|
-
import consola from "consola";
|
|
16
|
+
import { consola } from "consola";
|
|
17
17
|
import { flatten, parse } from "valibot";
|
|
18
18
|
|
|
19
19
|
// src/types.ts
|
|
@@ -35,6 +35,7 @@ var FolderStructureSchema = object({
|
|
|
35
35
|
accounts: string(),
|
|
36
36
|
sessions: string(),
|
|
37
37
|
cache: string(),
|
|
38
|
+
logs: string(),
|
|
38
39
|
site: string()
|
|
39
40
|
});
|
|
40
41
|
var ConfigSchema = object({
|
|
@@ -45,7 +46,12 @@ var ConfigSchema = object({
|
|
|
45
46
|
token: optional(string()),
|
|
46
47
|
remoteDir: optional(string()),
|
|
47
48
|
folderStructure: optional(
|
|
48
|
-
union([
|
|
49
|
+
union([
|
|
50
|
+
literal("flat"),
|
|
51
|
+
literal("public"),
|
|
52
|
+
literal("composer"),
|
|
53
|
+
FolderStructureSchema
|
|
54
|
+
])
|
|
49
55
|
),
|
|
50
56
|
checkComposerLock: optional(boolean()),
|
|
51
57
|
callWebhooks: optional(boolean()),
|
|
@@ -62,6 +68,7 @@ var ConfigSchema = object({
|
|
|
62
68
|
|
|
63
69
|
// src/config.ts
|
|
64
70
|
var loadConfig = async () => {
|
|
71
|
+
var _a;
|
|
65
72
|
let { config, configFile } = await load({
|
|
66
73
|
name: "kirby-deploy",
|
|
67
74
|
dotenv: true
|
|
@@ -89,15 +96,27 @@ ${info}`);
|
|
|
89
96
|
accounts: "storage/accounts",
|
|
90
97
|
sessions: "storage/sessions",
|
|
91
98
|
cache: "storage/cache",
|
|
99
|
+
logs: "storage/logs",
|
|
92
100
|
site: "site"
|
|
93
101
|
};
|
|
94
102
|
} else if (config.folderStructure === "flat") {
|
|
95
103
|
folderStructure = {
|
|
96
104
|
content: "content",
|
|
97
|
-
media: "
|
|
105
|
+
media: "media",
|
|
98
106
|
accounts: "site/accounts",
|
|
99
107
|
sessions: "site/sessions",
|
|
100
108
|
cache: "site/cache",
|
|
109
|
+
logs: "site/logs",
|
|
110
|
+
site: "site"
|
|
111
|
+
};
|
|
112
|
+
} else if (config.folderStructure === "composer") {
|
|
113
|
+
folderStructure = {
|
|
114
|
+
content: "data/storage/content",
|
|
115
|
+
media: "public/media",
|
|
116
|
+
accounts: "data/storage/accounts",
|
|
117
|
+
sessions: "data/runtime/sessions",
|
|
118
|
+
cache: "data/runtime/cache",
|
|
119
|
+
logs: "data/runtime/logs",
|
|
101
120
|
site: "site"
|
|
102
121
|
};
|
|
103
122
|
} else {
|
|
@@ -115,6 +134,7 @@ ${info}`);
|
|
|
115
134
|
include: [],
|
|
116
135
|
includeGlob: [],
|
|
117
136
|
...config,
|
|
137
|
+
url: (_a = config.url) == null ? void 0 : _a.replace(/\/$/, ""),
|
|
118
138
|
folderStructure,
|
|
119
139
|
lftpSettings: {
|
|
120
140
|
"ftp:ssl-force": true,
|
|
@@ -127,7 +147,7 @@ ${info}`);
|
|
|
127
147
|
|
|
128
148
|
// src/lftp/cat.ts
|
|
129
149
|
import { spawnSync } from "child_process";
|
|
130
|
-
import consola2 from "consola";
|
|
150
|
+
import { consola as consola2 } from "consola";
|
|
131
151
|
import { platform } from "os";
|
|
132
152
|
var cat = (file, { host, user, password, lftpSettings }) => {
|
|
133
153
|
const commands = [
|
|
@@ -143,19 +163,23 @@ var cat = (file, { host, user, password, lftpSettings }) => {
|
|
|
143
163
|
const child = isWindows ? spawnSync("wsl", ["lftp", "-c", commands.join("; ")], {
|
|
144
164
|
encoding: "utf-8"
|
|
145
165
|
}) : spawnSync("lftp", ["-c", commands.join("; ")], { encoding: "utf-8" });
|
|
146
|
-
if (child.stderr)
|
|
166
|
+
if (child.stderr) {
|
|
167
|
+
if (child.stderr.includes("550")) return void 0;
|
|
168
|
+
consola2.error(child.stderr);
|
|
169
|
+
return void 0;
|
|
170
|
+
}
|
|
147
171
|
return child.stdout;
|
|
148
172
|
};
|
|
149
173
|
|
|
150
174
|
// src/sync.ts
|
|
151
|
-
import consola5 from "consola";
|
|
175
|
+
import { consola as consola5 } from "consola";
|
|
152
176
|
import { join as join2 } from "path/posix";
|
|
153
177
|
|
|
154
178
|
// src/lftp/mirror.ts
|
|
155
|
-
import consola3 from "consola";
|
|
179
|
+
import { consola as consola3 } from "consola";
|
|
156
180
|
import { colors } from "consola/utils";
|
|
157
|
-
import { spawn } from "
|
|
158
|
-
import { platform as platform2 } from "
|
|
181
|
+
import { spawn } from "child_process";
|
|
182
|
+
import { platform as platform2 } from "os";
|
|
159
183
|
var mirror = (source, destination, flags, { lftpSettings, host, user, password, verbose }) => {
|
|
160
184
|
const commands = [
|
|
161
185
|
...Object.entries(lftpSettings).map(
|
|
@@ -212,13 +236,13 @@ ${colors.bgBlue(" LFTP ")} ${commands.join("; ")}
|
|
|
212
236
|
};
|
|
213
237
|
|
|
214
238
|
// src/utils.ts
|
|
215
|
-
import consola4 from "consola";
|
|
239
|
+
import { consola as consola4 } from "consola";
|
|
216
240
|
import { colors as colors2 } from "consola/utils";
|
|
217
|
-
import { spawnSync as spawnSync2 } from "
|
|
218
|
-
import { existsSync } from "
|
|
219
|
-
import { join } from "
|
|
220
|
-
import { cwd, stdin as input, stdout as output } from "
|
|
221
|
-
import * as readline from "
|
|
241
|
+
import { spawnSync as spawnSync2 } from "child_process";
|
|
242
|
+
import { existsSync } from "fs";
|
|
243
|
+
import { join } from "path";
|
|
244
|
+
import { cwd, stdin as input, stdout as output } from "process";
|
|
245
|
+
import * as readline from "readline";
|
|
222
246
|
var upperFirst = (string2) => string2.charAt(0).toUpperCase() + string2.slice(1);
|
|
223
247
|
var isGit = () => existsSync(join(cwd(), ".git"));
|
|
224
248
|
var getBranch = () => {
|
|
@@ -339,7 +363,7 @@ var sync = async (source, mode, config) => {
|
|
|
339
363
|
|
|
340
364
|
// src/commands/accounts.ts
|
|
341
365
|
import { defineCommand } from "citty";
|
|
342
|
-
import consola6 from "consola";
|
|
366
|
+
import { consola as consola6 } from "consola";
|
|
343
367
|
import { colors as colors3 } from "consola/utils";
|
|
344
368
|
import { join as join3 } from "path/posix";
|
|
345
369
|
var syncAccounts = async (mode) => {
|
|
@@ -375,7 +399,7 @@ var accountsPull = defineCommand({ run: () => syncAccounts("pull") });
|
|
|
375
399
|
|
|
376
400
|
// src/commands/content.ts
|
|
377
401
|
import { defineCommand as defineCommand2 } from "citty";
|
|
378
|
-
import consola7 from "consola";
|
|
402
|
+
import { consola as consola7 } from "consola";
|
|
379
403
|
import { colors as colors4 } from "consola/utils";
|
|
380
404
|
import { join as join4 } from "path/posix";
|
|
381
405
|
var syncContent = async (mode) => {
|
|
@@ -410,7 +434,7 @@ var contentPull = defineCommand2({ run: () => syncContent("pull") });
|
|
|
410
434
|
|
|
411
435
|
// src/commands/languages.ts
|
|
412
436
|
import { defineCommand as defineCommand3 } from "citty";
|
|
413
|
-
import consola8 from "consola";
|
|
437
|
+
import { consola as consola8 } from "consola";
|
|
414
438
|
import { colors as colors5 } from "consola/utils";
|
|
415
439
|
import { join as join5 } from "path/posix";
|
|
416
440
|
var syncLanguages = async (mode) => {
|
|
@@ -461,6 +485,7 @@ var main = defineCommand4({
|
|
|
461
485
|
`^${relative(cwd2(), folderStructure.accounts)}`,
|
|
462
486
|
`^${relative(cwd2(), folderStructure.sessions)}`,
|
|
463
487
|
`^${relative(cwd2(), folderStructure.cache)}`,
|
|
488
|
+
`^${relative(cwd2(), folderStructure.logs)}`,
|
|
464
489
|
`^${relative(cwd2(), join6(folderStructure.site, "languages"))}`
|
|
465
490
|
];
|
|
466
491
|
const excludeGlob = [...config.excludeGlob, ".*", ".*/"];
|
|
@@ -478,7 +503,7 @@ var main = defineCommand4({
|
|
|
478
503
|
encoding: "utf-8"
|
|
479
504
|
});
|
|
480
505
|
const remoteComposerLock = cat("./composer.lock", config);
|
|
481
|
-
const skipVendor = localComposerLock === remoteComposerLock;
|
|
506
|
+
const skipVendor = remoteComposerLock !== void 0 && localComposerLock === remoteComposerLock;
|
|
482
507
|
if (skipVendor) {
|
|
483
508
|
exclude.push("^vendor/", "^kirby/");
|
|
484
509
|
consola9.info("Skipping vendor\n");
|
package/dist/index.d.ts
CHANGED
|
@@ -5,28 +5,29 @@ declare const ConfigSchema: valibot.ObjectSchema<{
|
|
|
5
5
|
readonly host: valibot.StringSchema<undefined>;
|
|
6
6
|
readonly user: valibot.StringSchema<undefined>;
|
|
7
7
|
readonly password: valibot.StringSchema<undefined>;
|
|
8
|
-
readonly url: valibot.OptionalSchema<valibot.StringSchema<undefined>,
|
|
9
|
-
readonly token: valibot.OptionalSchema<valibot.StringSchema<undefined>,
|
|
10
|
-
readonly remoteDir: valibot.OptionalSchema<valibot.StringSchema<undefined>,
|
|
11
|
-
readonly folderStructure: valibot.OptionalSchema<valibot.UnionSchema<[valibot.LiteralSchema<"flat", undefined>, valibot.LiteralSchema<"public", undefined>, valibot.ObjectSchema<{
|
|
8
|
+
readonly url: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
|
|
9
|
+
readonly token: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
|
|
10
|
+
readonly remoteDir: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
|
|
11
|
+
readonly folderStructure: valibot.OptionalSchema<valibot.UnionSchema<[valibot.LiteralSchema<"flat", undefined>, valibot.LiteralSchema<"public", undefined>, valibot.LiteralSchema<"composer", undefined>, valibot.ObjectSchema<{
|
|
12
12
|
readonly content: valibot.StringSchema<undefined>;
|
|
13
13
|
readonly media: valibot.StringSchema<undefined>;
|
|
14
14
|
readonly accounts: valibot.StringSchema<undefined>;
|
|
15
15
|
readonly sessions: valibot.StringSchema<undefined>;
|
|
16
16
|
readonly cache: valibot.StringSchema<undefined>;
|
|
17
|
+
readonly logs: valibot.StringSchema<undefined>;
|
|
17
18
|
readonly site: valibot.StringSchema<undefined>;
|
|
18
|
-
}, undefined>], undefined>,
|
|
19
|
-
readonly checkComposerLock: valibot.OptionalSchema<valibot.BooleanSchema<undefined>,
|
|
20
|
-
readonly callWebhooks: valibot.OptionalSchema<valibot.BooleanSchema<undefined>,
|
|
21
|
-
readonly dryRun: valibot.OptionalSchema<valibot.BooleanSchema<undefined>,
|
|
22
|
-
readonly verbose: valibot.OptionalSchema<valibot.BooleanSchema<undefined>,
|
|
23
|
-
readonly parallel: valibot.OptionalSchema<valibot.NumberSchema<undefined>,
|
|
24
|
-
readonly exclude: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>,
|
|
25
|
-
readonly excludeGlob: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>,
|
|
26
|
-
readonly include: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>,
|
|
27
|
-
readonly includeGlob: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>,
|
|
28
|
-
readonly lftpSettings: valibot.OptionalSchema<valibot.RecordSchema<valibot.StringSchema<undefined>, valibot.AnySchema, undefined>,
|
|
29
|
-
readonly lftpFlags: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>,
|
|
19
|
+
}, undefined>], undefined>, undefined>;
|
|
20
|
+
readonly checkComposerLock: valibot.OptionalSchema<valibot.BooleanSchema<undefined>, undefined>;
|
|
21
|
+
readonly callWebhooks: valibot.OptionalSchema<valibot.BooleanSchema<undefined>, undefined>;
|
|
22
|
+
readonly dryRun: valibot.OptionalSchema<valibot.BooleanSchema<undefined>, undefined>;
|
|
23
|
+
readonly verbose: valibot.OptionalSchema<valibot.BooleanSchema<undefined>, undefined>;
|
|
24
|
+
readonly parallel: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
25
|
+
readonly exclude: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
|
|
26
|
+
readonly excludeGlob: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
|
|
27
|
+
readonly include: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
|
|
28
|
+
readonly includeGlob: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
|
|
29
|
+
readonly lftpSettings: valibot.OptionalSchema<valibot.RecordSchema<valibot.StringSchema<undefined>, valibot.AnySchema, undefined>, undefined>;
|
|
30
|
+
readonly lftpFlags: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, undefined>;
|
|
30
31
|
}, undefined>;
|
|
31
32
|
type Config = InferInput<typeof ConfigSchema>;
|
|
32
33
|
|
|
@@ -37,12 +38,13 @@ declare const defineConfig: (config: Config) => {
|
|
|
37
38
|
url?: string | undefined;
|
|
38
39
|
token?: string | undefined;
|
|
39
40
|
remoteDir?: string | undefined;
|
|
40
|
-
folderStructure?: "flat" | "public" | {
|
|
41
|
+
folderStructure?: "flat" | "public" | "composer" | {
|
|
41
42
|
content: string;
|
|
42
43
|
media: string;
|
|
43
44
|
accounts: string;
|
|
44
45
|
sessions: string;
|
|
45
46
|
cache: string;
|
|
47
|
+
logs: string;
|
|
46
48
|
site: string;
|
|
47
49
|
} | undefined;
|
|
48
50
|
checkComposerLock?: boolean | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kirby-deploy",
|
|
3
|
-
"version": "0.2
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -9,22 +9,26 @@
|
|
|
9
9
|
"keywords": [],
|
|
10
10
|
"author": "Arno Schlipf",
|
|
11
11
|
"license": "MIT",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/arnoson/kirby-deploy"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsup src/index.ts src/cli.ts --format esm --dts",
|
|
18
|
+
"dev": "tsup src/index.ts src/cli.ts --format esm --watch",
|
|
19
|
+
"type-check": "tsc --noEmit"
|
|
20
|
+
},
|
|
12
21
|
"devDependencies": {
|
|
13
|
-
"@prettier/plugin-php": "^0.
|
|
22
|
+
"@prettier/plugin-php": "^0.24.0",
|
|
14
23
|
"@types/node": "^20.16.10",
|
|
15
24
|
"prettier": "^3.3.3",
|
|
16
25
|
"tsup": "^8.3.0",
|
|
17
26
|
"typescript": "^5.6.2"
|
|
18
27
|
},
|
|
19
28
|
"dependencies": {
|
|
20
|
-
"c12": "^
|
|
29
|
+
"c12": "^3.0.0",
|
|
21
30
|
"citty": "^0.1.6",
|
|
22
31
|
"consola": "^3.2.3",
|
|
23
|
-
"valibot": "^0.
|
|
24
|
-
},
|
|
25
|
-
"scripts": {
|
|
26
|
-
"build": "tsup src/index.ts src/cli.ts --format esm --dts",
|
|
27
|
-
"dev": "tsup src/index.ts src/cli.ts --format esm --watch",
|
|
28
|
-
"type-check": "tsc --noEmit"
|
|
32
|
+
"valibot": "^1.0.0"
|
|
29
33
|
}
|
|
30
|
-
}
|
|
34
|
+
}
|
package/src/commands/accounts.ts
CHANGED
package/src/commands/content.ts
CHANGED
package/src/commands/main.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineCommand } from 'citty'
|
|
2
|
-
import consola from 'consola'
|
|
2
|
+
import { consola } from 'consola'
|
|
3
3
|
import { colors } from 'consola/utils'
|
|
4
4
|
import { readFileSync } from 'fs'
|
|
5
5
|
import { join, relative } from 'path/posix'
|
|
@@ -33,6 +33,7 @@ export const main = defineCommand({
|
|
|
33
33
|
`^${relative(cwd(), folderStructure.accounts)}`,
|
|
34
34
|
`^${relative(cwd(), folderStructure.sessions)}`,
|
|
35
35
|
`^${relative(cwd(), folderStructure.cache)}`,
|
|
36
|
+
`^${relative(cwd(), folderStructure.logs)}`,
|
|
36
37
|
`^${relative(cwd(), join(folderStructure.site, 'languages'))}`,
|
|
37
38
|
]
|
|
38
39
|
const excludeGlob = [...config.excludeGlob, '.*', '.*/']
|
|
@@ -51,7 +52,9 @@ export const main = defineCommand({
|
|
|
51
52
|
encoding: 'utf-8',
|
|
52
53
|
})
|
|
53
54
|
const remoteComposerLock = cat('./composer.lock', config)
|
|
54
|
-
const skipVendor =
|
|
55
|
+
const skipVendor =
|
|
56
|
+
remoteComposerLock !== undefined &&
|
|
57
|
+
localComposerLock === remoteComposerLock
|
|
55
58
|
if (skipVendor) {
|
|
56
59
|
exclude.push('^vendor/', '^kirby/')
|
|
57
60
|
consola.info('Skipping vendor\n')
|
package/src/config.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { loadConfig as load } from 'c12'
|
|
2
|
-
import consola from 'consola'
|
|
2
|
+
import { consola } from 'consola'
|
|
3
3
|
import { flatten, parse } from 'valibot'
|
|
4
4
|
import { Config, ConfigResolved, ConfigSchema, FolderStructure } from './types'
|
|
5
5
|
|
|
@@ -28,7 +28,6 @@ export const loadConfig = async (): Promise<ConfigResolved | null> => {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
// Resolve shorthands
|
|
31
|
-
|
|
32
31
|
let folderStructure: FolderStructure
|
|
33
32
|
config.folderStructure ??= 'flat'
|
|
34
33
|
if (config.folderStructure === 'public') {
|
|
@@ -38,16 +37,28 @@ export const loadConfig = async (): Promise<ConfigResolved | null> => {
|
|
|
38
37
|
accounts: 'storage/accounts',
|
|
39
38
|
sessions: 'storage/sessions',
|
|
40
39
|
cache: 'storage/cache',
|
|
40
|
+
logs: 'storage/logs',
|
|
41
41
|
site: 'site',
|
|
42
42
|
}
|
|
43
43
|
} else if (config.folderStructure === 'flat') {
|
|
44
44
|
// 'flat' structure is the default.
|
|
45
45
|
folderStructure = {
|
|
46
46
|
content: 'content',
|
|
47
|
-
media: '
|
|
47
|
+
media: 'media',
|
|
48
48
|
accounts: 'site/accounts',
|
|
49
49
|
sessions: 'site/sessions',
|
|
50
50
|
cache: 'site/cache',
|
|
51
|
+
logs: 'site/logs',
|
|
52
|
+
site: 'site',
|
|
53
|
+
}
|
|
54
|
+
} else if (config.folderStructure === 'composer') {
|
|
55
|
+
folderStructure = {
|
|
56
|
+
content: 'data/storage/content',
|
|
57
|
+
media: 'public/media',
|
|
58
|
+
accounts: 'data/storage/accounts',
|
|
59
|
+
sessions: 'data/runtime/sessions',
|
|
60
|
+
cache: 'data/runtime/cache',
|
|
61
|
+
logs: 'data/runtime/logs',
|
|
51
62
|
site: 'site',
|
|
52
63
|
}
|
|
53
64
|
} else {
|
|
@@ -66,6 +77,7 @@ export const loadConfig = async (): Promise<ConfigResolved | null> => {
|
|
|
66
77
|
include: [],
|
|
67
78
|
includeGlob: [],
|
|
68
79
|
...config,
|
|
80
|
+
url: config.url?.replace(/\/$/, ''),
|
|
69
81
|
folderStructure,
|
|
70
82
|
lftpSettings: {
|
|
71
83
|
'ftp:ssl-force': true,
|
package/src/lftp/cat.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { spawnSync } from 'child_process'
|
|
2
|
-
import consola from 'consola'
|
|
2
|
+
import { consola } from 'consola'
|
|
3
3
|
import { platform } from 'os'
|
|
4
4
|
import { ConfigResolved } from '../types'
|
|
5
5
|
|
|
@@ -24,6 +24,11 @@ export const cat = (
|
|
|
24
24
|
})
|
|
25
25
|
: spawnSync('lftp', ['-c', commands.join('; ')], { encoding: 'utf-8' })
|
|
26
26
|
|
|
27
|
-
if (child.stderr)
|
|
27
|
+
if (child.stderr) {
|
|
28
|
+
// 550 means the file doesn't exist, silently return undefined
|
|
29
|
+
if (child.stderr.includes('550')) return undefined
|
|
30
|
+
consola.error(child.stderr)
|
|
31
|
+
return undefined
|
|
32
|
+
}
|
|
28
33
|
return child.stdout
|
|
29
34
|
}
|
package/src/lftp/mirror.ts
CHANGED
package/src/sync.ts
CHANGED
package/src/types.ts
CHANGED
|
@@ -18,6 +18,7 @@ export const FolderStructureSchema = object({
|
|
|
18
18
|
accounts: string(),
|
|
19
19
|
sessions: string(),
|
|
20
20
|
cache: string(),
|
|
21
|
+
logs: string(),
|
|
21
22
|
site: string(),
|
|
22
23
|
})
|
|
23
24
|
|
|
@@ -31,7 +32,12 @@ export const ConfigSchema = object({
|
|
|
31
32
|
token: optional(string()),
|
|
32
33
|
remoteDir: optional(string()),
|
|
33
34
|
folderStructure: optional(
|
|
34
|
-
union([
|
|
35
|
+
union([
|
|
36
|
+
literal('flat'),
|
|
37
|
+
literal('public'),
|
|
38
|
+
literal('composer'),
|
|
39
|
+
FolderStructureSchema,
|
|
40
|
+
]),
|
|
35
41
|
),
|
|
36
42
|
checkComposerLock: optional(boolean()),
|
|
37
43
|
callWebhooks: optional(boolean()),
|
package/src/utils.ts
CHANGED