@flowscripter/flowscripter-io-cli 2.0.11 → 3.0.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/README.md +70 -34
- package/bun.lock +59 -58
- package/functional_tests/features/commands.feature +76 -7
- package/functional_tests/features/steps/executable.py +6 -0
- package/functional_tests/features/steps/io_commands.py +5 -0
- package/package.json +12 -11
- package/src/cli.ts +19 -9
- package/src/commands/copy.ts +6 -62
- package/src/commands/delete.ts +28 -29
- package/src/commands/get-properties.ts +30 -34
- package/src/commands/hash.ts +102 -68
- package/src/commands/list.ts +76 -57
- package/src/commands/move.ts +6 -62
- package/src/commands/set-properties.ts +92 -37
- package/src/commands/transferCommand.ts +121 -0
- package/src/util/interruptSignals.ts +70 -0
- package/src/util/location/createLocationOption.ts +59 -0
- package/src/util/location/describeTarget.ts +6 -0
- package/src/util/location/targetKey.ts +9 -0
- package/src/util/location/toStructuredLocation.ts +8 -0
- package/src/util/payloadKindOption.ts +20 -0
- package/src/{pluginsDir.ts → util/pluginsDir.ts} +1 -1
- package/src/util/providerRegistry.ts +23 -0
- package/src/util/requireOperation.ts +19 -0
- package/src/util/zodToComplexOption.ts +93 -0
- package/tests/commands/copy.test.ts +80 -0
- package/tests/commands/delete.test.ts +44 -0
- package/tests/commands/get-properties.test.ts +52 -0
- package/tests/commands/hash.test.ts +76 -0
- package/tests/commands/list.test.ts +78 -0
- package/tests/commands/move.test.ts +45 -0
- package/tests/commands/set-properties.test.ts +68 -0
- package/tests/commands/transferCommand.test.ts +63 -0
- package/tests/fixtures/pluginStore.ts +39 -0
- package/tests/{testContext.ts → fixtures/testContext.ts} +17 -1
- package/tests/{byteScale_test.ts → util/byteScale.test.ts} +1 -1
- package/tests/util/interruptSignals.test.ts +80 -0
- package/tests/util/location/createLocationOption.test.ts +73 -0
- package/tests/util/location/describeTarget.test.ts +12 -0
- package/tests/util/location/targetKey.test.ts +15 -0
- package/tests/util/location/toStructuredLocation.test.ts +14 -0
- package/tests/util/payloadKindOption.test.ts +19 -0
- package/tests/util/providerRegistry.test.ts +39 -0
- package/tests/util/requireOperation.test.ts +25 -0
- package/tests/util/zodToComplexOption.test.ts +116 -0
- package/src/filesystemProvider.ts +0 -40
- package/tests/commands_test.ts +0 -186
- /package/src/{byteScale.ts → util/byteScale.ts} +0 -0
- /package/tests/{cli_test.ts → cli.test.ts} +0 -0
package/README.md
CHANGED
|
@@ -37,53 +37,89 @@ Via [Winget](https://github.com/microsoft/winget-cli):
|
|
|
37
37
|
You can download and extract the binary zip files from the
|
|
38
38
|
[releases](https://github.com/flowscripter/flowscripter-io-cli/releases) page.
|
|
39
39
|
|
|
40
|
+
## Locations
|
|
41
|
+
|
|
42
|
+
Every command addresses data through a location argument: `--source` and
|
|
43
|
+
`--dest` for `copy`/`move`, and `--location` for the other commands. A
|
|
44
|
+
location has a `protocol` and one group of fields per installed protocol:
|
|
45
|
+
|
|
46
|
+
- `--location.protocol=file` selects the protocol. The allowed values are
|
|
47
|
+
the protocols of the installed provider plugins.
|
|
48
|
+
- `--location.file.path=/data` and the other fields of the selected protocol
|
|
49
|
+
are taken from that protocol's provider plugin, and are validated against
|
|
50
|
+
it.
|
|
51
|
+
- For `file` (and other protocols with folders), a location with a
|
|
52
|
+
`filename` addresses one file, one with a `pattern` (a glob such as
|
|
53
|
+
`*.txt`) addresses the matching files in `path`, and one with neither
|
|
54
|
+
addresses the whole `path` folder.
|
|
55
|
+
|
|
56
|
+
`flowscripter-io-cli <command> --help` lists the fields of every installed
|
|
57
|
+
protocol.
|
|
58
|
+
|
|
40
59
|
## Commands
|
|
41
60
|
|
|
42
|
-
- `list
|
|
43
|
-
|
|
44
|
-
- `
|
|
45
|
-
- `
|
|
46
|
-
|
|
47
|
-
|
|
61
|
+
- `list --location [--recursive] [--regex]` - list a folder, or the files
|
|
62
|
+
matching a pattern location, one JSON line per item
|
|
63
|
+
- `get-properties --location` - print a file or folder's properties as JSON
|
|
64
|
+
- `set-properties --location [--last-modified] [--content-type] [--properties.<protocol>.<name>]` - set properties: last modified time and
|
|
65
|
+
content type apply to every protocol, and `--properties` holds one group
|
|
66
|
+
per protocol for its own settable properties (e.g.
|
|
67
|
+
`--properties.file.mode=384`)
|
|
68
|
+
- `delete --location` - delete a file or folder
|
|
69
|
+
- `copy --source --dest [--payload-kind]` - copy a file, a folder, or the
|
|
70
|
+
files matching a pattern, using a direct provider copy when possible, with
|
|
71
|
+
a progress bar for a single file. Prints the negotiated transfer path,
|
|
72
|
+
e.g. `path: file/js -> file/js, direct`
|
|
73
|
+
- `move --source --dest [--payload-kind]` - move, with the same behaviour as
|
|
74
|
+
`copy`
|
|
75
|
+
- `hash --location [--algorithm] [--payload-kind]` - hash a file by reading
|
|
76
|
+
its stream directly, outside the framework's transfer path. `--algorithm`
|
|
77
|
+
is one of `sha1`, `sha256` (the default, using a native hasher), `sha384`,
|
|
78
|
+
`sha512` or `md5`
|
|
79
|
+
|
|
80
|
+
Common behaviour:
|
|
81
|
+
|
|
82
|
+
- `--payload-kind` is `auto` (the default, letting the registry choose),
|
|
83
|
+
`js` or `native`. An unavailable kind fails with the kinds that are
|
|
84
|
+
installed.
|
|
85
|
+
- During `list`, `copy`, `move` or `hash`, the first Ctrl-C stops gracefully and
|
|
86
|
+
reports the result as stopped, and a second Ctrl-C cancels.
|
|
87
|
+
- Operations a protocol does not support (e.g. `list` over `https`) fail with
|
|
88
|
+
a "not supported by protocol" error.
|
|
89
|
+
- Any required argument omitted on the command line is prompted for
|
|
90
|
+
interactively, via
|
|
48
91
|
[dynamic-cli-framework](https://github.com/flowscripter/dynamic-cli-framework)'s
|
|
49
|
-
`
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
`--algorithm` is restricted to a curated set (`sha1`, `sha256`, `sha384`,
|
|
56
|
-
`sha512`, `md5`)
|
|
57
|
-
|
|
58
|
-
Any argument omitted on the command line (e.g. running `copy` with no
|
|
59
|
-
`source`/`destination`) is interactively prompted for instead of failing,
|
|
60
|
-
via [dynamic-cli-framework](https://github.com/flowscripter/dynamic-cli-framework)'s
|
|
61
|
-
`ArgumentPrompterService`. Confirmation messages (`copy`, `move`, `delete`,
|
|
62
|
-
`set-properties`) are prefixed with a success icon.
|
|
63
|
-
|
|
64
|
-
All commands operate against a filesystem source/sink provider - rooted at
|
|
65
|
-
`/`, so any absolute or cwd-relative path works, the same as any normal file
|
|
66
|
-
tool. **This package has no dependency on any provider plugin** - one must
|
|
67
|
-
be installed first via the CLI's own plugin management (provided by
|
|
92
|
+
`ArgumentPrompterService`.
|
|
93
|
+
|
|
94
|
+
## Provider Plugins
|
|
95
|
+
|
|
96
|
+
This package has no dependency on any provider plugin. Install one or more
|
|
97
|
+
through the CLI's own plugin management (provided by
|
|
68
98
|
[dynamic-cli-framework](https://github.com/flowscripter/dynamic-cli-framework)'s
|
|
69
|
-
`plugin` commands)
|
|
99
|
+
`plugin` commands). They are discovered at startup through
|
|
70
100
|
[dynamic-plugin-framework](https://github.com/flowscripter/dynamic-plugin-framework)'s
|
|
71
|
-
`NpmPluginRepository
|
|
101
|
+
`NpmPluginRepository`, and several protocols, or several implementations of
|
|
102
|
+
one protocol, can be installed side by side:
|
|
72
103
|
|
|
73
104
|
```
|
|
74
|
-
|
|
105
|
+
flowscripter-io-cli plugin:add @flowscripter/io-plugin-filesystem
|
|
75
106
|
```
|
|
76
107
|
|
|
77
108
|
## Usage
|
|
78
109
|
|
|
79
|
-
Once installed (see [Installation](#installation))
|
|
80
|
-
below with `flowscripter-io-cli`:
|
|
110
|
+
Once installed (see [Installation](#installation)):
|
|
81
111
|
|
|
82
112
|
```
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
113
|
+
flowscripter-io-cli plugin:add @flowscripter/io-plugin-filesystem
|
|
114
|
+
flowscripter-io-cli list --location.protocol=file --location.file.path=.
|
|
115
|
+
flowscripter-io-cli copy \
|
|
116
|
+
--source.protocol=file --source.file.path=. --source.file.filename=a.txt \
|
|
117
|
+
--dest.protocol=file --dest.file.path=. --dest.file.filename=b.txt
|
|
118
|
+
flowscripter-io-cli copy \
|
|
119
|
+
--source.protocol=file --source.file.path=. --source.file.pattern='*.txt' \
|
|
120
|
+
--dest.protocol=file --dest.file.path=backup
|
|
121
|
+
flowscripter-io-cli hash --location.protocol=file --location.file.path=. \
|
|
122
|
+
--location.file.filename=a.txt --algorithm sha256
|
|
87
123
|
```
|
|
88
124
|
|
|
89
125
|
## Development
|
package/bun.lock
CHANGED
|
@@ -5,19 +5,20 @@
|
|
|
5
5
|
"": {
|
|
6
6
|
"name": "@flowscripter/flowscripter-io-cli",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@flowscripter/dynamic-cli-framework": "^
|
|
9
|
-
"@flowscripter/dynamic-cli-framework-api": "^
|
|
10
|
-
"@flowscripter/dynamic-plugin-framework": "^2.2.
|
|
11
|
-
"@flowscripter/flowscripter-io-cli-hash-native": "^1.0.
|
|
12
|
-
"@flowscripter/pluggable-io-framework": "^1.
|
|
13
|
-
"@flowscripter/pluggable-io-framework-api": "^1.1
|
|
8
|
+
"@flowscripter/dynamic-cli-framework": "^9.0.0",
|
|
9
|
+
"@flowscripter/dynamic-cli-framework-api": "^5.0.0",
|
|
10
|
+
"@flowscripter/dynamic-plugin-framework": "^2.2.19",
|
|
11
|
+
"@flowscripter/flowscripter-io-cli-hash-native": "^1.0.13",
|
|
12
|
+
"@flowscripter/pluggable-io-framework": "^2.1.0",
|
|
13
|
+
"@flowscripter/pluggable-io-framework-api": "^3.1.1",
|
|
14
|
+
"zod": "^4.6.5",
|
|
14
15
|
},
|
|
15
16
|
"devDependencies": {
|
|
16
|
-
"@flowscripter/io-plugin-filesystem": "^
|
|
17
|
+
"@flowscripter/io-plugin-filesystem": "^2.0.2",
|
|
17
18
|
"@types/bun": "^1.4.2",
|
|
18
|
-
"@types/node": "^26.6.
|
|
19
|
-
"oxfmt": "0.
|
|
20
|
-
"oxlint": "1.
|
|
19
|
+
"@types/node": "^26.6.4",
|
|
20
|
+
"oxfmt": "0.72.0",
|
|
21
|
+
"oxlint": "1.87.0",
|
|
21
22
|
},
|
|
22
23
|
"peerDependencies": {
|
|
23
24
|
"typescript": "^7.0.2",
|
|
@@ -25,101 +26,101 @@
|
|
|
25
26
|
},
|
|
26
27
|
},
|
|
27
28
|
"packages": {
|
|
28
|
-
"@flowscripter/dynamic-cli-framework": ["@flowscripter/dynamic-cli-framework@
|
|
29
|
+
"@flowscripter/dynamic-cli-framework": ["@flowscripter/dynamic-cli-framework@9.0.0", "", { "dependencies": { "@flowscripter/dynamic-cli-framework-api": "^5.0.0", "@flowscripter/dynamic-plugin-framework": "^2.2.16", "emphasize": "^7.0.0", "fastest-levenshtein": "^1.0.16", "figlet": "^1.12.0", "highlight.js": "^11.12.0", "prettier": "^3.9.9", "semver": "^7.8.5", "supports-color": "^11.0.0", "supports-terminal-graphics": "^0.1.0" }, "peerDependencies": { "typescript": "^7.0.2" } }, "sha512-CUPz8Iusp1tTTpVAHUdDYNk/tQuQwsZEt7wmomxmjCEI4s/4ROde0qIvvqsqfx5jHF84vvjoxbQ5Uhdm79evwA=="],
|
|
29
30
|
|
|
30
|
-
"@flowscripter/dynamic-cli-framework-api": ["@flowscripter/dynamic-cli-framework-api@
|
|
31
|
+
"@flowscripter/dynamic-cli-framework-api": ["@flowscripter/dynamic-cli-framework-api@5.0.0", "", { "peerDependencies": { "typescript": "^7.0.2" } }, "sha512-mF2V1Np+MKSQqeXGJO8WWT2dNiVlAKg1gFrf+lPriWBXLZFyv9JU44gDYtCMfenQuoaHMb3IgOwIfVeBclvYhQ=="],
|
|
31
32
|
|
|
32
|
-
"@flowscripter/dynamic-plugin-framework": ["@flowscripter/dynamic-plugin-framework@2.2.
|
|
33
|
+
"@flowscripter/dynamic-plugin-framework": ["@flowscripter/dynamic-plugin-framework@2.2.19", "", { "dependencies": { "semver": "^7.8.5" }, "peerDependencies": { "typescript": "^7.0.2" } }, "sha512-sAJppm6IyDdNJjOH5Bh/odrsb5vXNwgBGdU1NITjR3LqaJRFLTfuSepvX00NEgcUt3DMRmxJYiUyGrEJimLJgQ=="],
|
|
33
34
|
|
|
34
|
-
"@flowscripter/flowscripter-io-cli-hash-native": ["@flowscripter/flowscripter-io-cli-hash-native@1.0.
|
|
35
|
+
"@flowscripter/flowscripter-io-cli-hash-native": ["@flowscripter/flowscripter-io-cli-hash-native@1.0.13", "", { "peerDependencies": { "typescript": "^7.0.2" } }, "sha512-I5jCqiHvDMenNajwT075dVQxgYxbPuDAqtJcrQf/el+U2Wh+Xj7E0/fOoMeDq0kOZY+zZmr/7KeYBow/FzLxpA=="],
|
|
35
36
|
|
|
36
|
-
"@flowscripter/io-plugin-filesystem": ["@flowscripter/io-plugin-filesystem@
|
|
37
|
+
"@flowscripter/io-plugin-filesystem": ["@flowscripter/io-plugin-filesystem@2.0.2", "", { "dependencies": { "@flowscripter/pluggable-io-framework-api": "^3.1.1", "zod": "^4.6.5" }, "peerDependencies": { "@flowscripter/dynamic-plugin-framework": "*", "typescript": "^7.0.2" } }, "sha512-Tze5MN0KqGWOrqP+3pxa+wrCkNxW0fdPOLHcPyNphwmepP8Q1VOL+/8hil//qeIiEmIEdWr4BLWaJM9+NSH+fg=="],
|
|
37
38
|
|
|
38
|
-
"@flowscripter/pluggable-io-framework": ["@flowscripter/pluggable-io-framework@1.
|
|
39
|
+
"@flowscripter/pluggable-io-framework": ["@flowscripter/pluggable-io-framework@2.1.0", "", { "dependencies": { "@flowscripter/dynamic-plugin-framework": "^2.2.18", "@flowscripter/pluggable-io-framework-api": "^3.1.1" }, "peerDependencies": { "typescript": "^7.0.2" } }, "sha512-x3KnImZpuY5J24+iGOOJci8Rk12l7nBCq/jKJWINJuZLKqFtPYXRtVff5V7gOFlnBE6fiKNp0UL26clcsYhk6Q=="],
|
|
39
40
|
|
|
40
|
-
"@flowscripter/pluggable-io-framework-api": ["@flowscripter/pluggable-io-framework-api@1.1
|
|
41
|
+
"@flowscripter/pluggable-io-framework-api": ["@flowscripter/pluggable-io-framework-api@3.1.1", "", { "dependencies": { "zod": "^4.6.5", "zod-to-json-schema": "^3.25.2" }, "peerDependencies": { "typescript": "^7.0.2" } }, "sha512-AnXneT+Qrr+/vkgoghOn857SOmjy7/NwXS3uND//vqwBaHJIDK2aGfmJnod+oY29LyEwpiDlg7Uxcdd/V0tyBw=="],
|
|
41
42
|
|
|
42
|
-
"@oxfmt/binding-android-arm-eabi": ["@oxfmt/binding-android-arm-eabi@0.
|
|
43
|
+
"@oxfmt/binding-android-arm-eabi": ["@oxfmt/binding-android-arm-eabi@0.72.0", "", { "os": "android", "cpu": "arm" }, "sha512-u4U1uaDOVBuorGNC/07NLm48nECHOiJJka002YGML16Md2DRvf38RGBt01lH60EOGvNlFVmbLoksQedNBoZHKw=="],
|
|
43
44
|
|
|
44
|
-
"@oxfmt/binding-android-arm64": ["@oxfmt/binding-android-arm64@0.
|
|
45
|
+
"@oxfmt/binding-android-arm64": ["@oxfmt/binding-android-arm64@0.72.0", "", { "os": "android", "cpu": "arm64" }, "sha512-GCnM+Ae2mWOKC+92y3FOb6eZJeVnBAVz82e3lITUUg+kxukYKzBNAvJ/hhHIfa2A0md55SYYhdWPddSSy3KPVA=="],
|
|
45
46
|
|
|
46
|
-
"@oxfmt/binding-darwin-arm64": ["@oxfmt/binding-darwin-arm64@0.
|
|
47
|
+
"@oxfmt/binding-darwin-arm64": ["@oxfmt/binding-darwin-arm64@0.72.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-LjQ8tlevdtwraFlWC6AnQ1Forzde0clRmnsP3QmK+ydSElDt/J+5Jc+m+//Ly1G97aP7WCNUw110QMIUw2K7xA=="],
|
|
47
48
|
|
|
48
|
-
"@oxfmt/binding-darwin-x64": ["@oxfmt/binding-darwin-x64@0.
|
|
49
|
+
"@oxfmt/binding-darwin-x64": ["@oxfmt/binding-darwin-x64@0.72.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-+ZbcxhB1C34RQR5IldSyY6Z/yalJIxHXhP36PGE4sEq0f/lgL5jCLmOKoDeVm8dqd9gFGDsd1bNWHSGCAwdSkw=="],
|
|
49
50
|
|
|
50
|
-
"@oxfmt/binding-freebsd-x64": ["@oxfmt/binding-freebsd-x64@0.
|
|
51
|
+
"@oxfmt/binding-freebsd-x64": ["@oxfmt/binding-freebsd-x64@0.72.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-yGPhA8sePEBFV9iGcprhyOk3Bz3fZshswMH3DpYIPZFLT1DG5LjiZ0j6AJQpSueaL6bUK0av1K+5+fe+ldy5EQ=="],
|
|
51
52
|
|
|
52
|
-
"@oxfmt/binding-linux-arm-gnueabihf": ["@oxfmt/binding-linux-arm-gnueabihf@0.
|
|
53
|
+
"@oxfmt/binding-linux-arm-gnueabihf": ["@oxfmt/binding-linux-arm-gnueabihf@0.72.0", "", { "os": "linux", "cpu": "arm" }, "sha512-/g5axuqFMcAtoQrFLR5EJEMDjR5Ea4GuzpdDmMpPWAgrF1DmL4kD1NPNVlpXEOxpFJnD6lPvLKYj1lzdlrfifA=="],
|
|
53
54
|
|
|
54
|
-
"@oxfmt/binding-linux-arm-musleabihf": ["@oxfmt/binding-linux-arm-musleabihf@0.
|
|
55
|
+
"@oxfmt/binding-linux-arm-musleabihf": ["@oxfmt/binding-linux-arm-musleabihf@0.72.0", "", { "os": "linux", "cpu": "arm" }, "sha512-InVitdHbS09PM+w+WinIiyX37rC9R3L7lUP9mKy9uKTEDSUFaLjWsLoreRIxKivnv7Ndqc6Trvi+K+b6ZzhiJg=="],
|
|
55
56
|
|
|
56
|
-
"@oxfmt/binding-linux-arm64-gnu": ["@oxfmt/binding-linux-arm64-gnu@0.
|
|
57
|
+
"@oxfmt/binding-linux-arm64-gnu": ["@oxfmt/binding-linux-arm64-gnu@0.72.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-WKjlyRAxpPjXoqeuwFBim5LscgvY+RNEiZ971C9JlRQZONhJTsXDki/oHFYQE+fzzRpzXh3owZvOdT3kNL2g+g=="],
|
|
57
58
|
|
|
58
|
-
"@oxfmt/binding-linux-arm64-musl": ["@oxfmt/binding-linux-arm64-musl@0.
|
|
59
|
+
"@oxfmt/binding-linux-arm64-musl": ["@oxfmt/binding-linux-arm64-musl@0.72.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-poafnbsPpJhR+5Mbwpf8CscugTyiRAzjTOxRVn8ra3X2jnURs2xL5Du2xl5g2iW85lICMglpmLf8jDjZEbNgzQ=="],
|
|
59
60
|
|
|
60
|
-
"@oxfmt/binding-linux-ppc64-gnu": ["@oxfmt/binding-linux-ppc64-gnu@0.
|
|
61
|
+
"@oxfmt/binding-linux-ppc64-gnu": ["@oxfmt/binding-linux-ppc64-gnu@0.72.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-zNUi0gKRsO7S3IfPzsTbnm88OedPuX32hmZFWZRWHvWJlAoZRwVbeO6Nb3hng4vDgL7qUKp4TGqzPz1mhsycYg=="],
|
|
61
62
|
|
|
62
|
-
"@oxfmt/binding-linux-riscv64-gnu": ["@oxfmt/binding-linux-riscv64-gnu@0.
|
|
63
|
+
"@oxfmt/binding-linux-riscv64-gnu": ["@oxfmt/binding-linux-riscv64-gnu@0.72.0", "", { "os": "linux", "cpu": "none" }, "sha512-qTY7z/iyF/rWI2HWwWMevXqZW5PZUOofUy2afK7v6rseXnpld3yjgyIk6pCux3DqWQ0lB+f5atvLJNBwzLvFsw=="],
|
|
63
64
|
|
|
64
|
-
"@oxfmt/binding-linux-riscv64-musl": ["@oxfmt/binding-linux-riscv64-musl@0.
|
|
65
|
+
"@oxfmt/binding-linux-riscv64-musl": ["@oxfmt/binding-linux-riscv64-musl@0.72.0", "", { "os": "linux", "cpu": "none" }, "sha512-w18qfo8vEMD6EKEHtzTvjc6jH8yCyXIT1Bn7PFWJd0PpZyzH/VQDx4xvjCh0LGz6GRzqiezbisTdG9AoXtpkZQ=="],
|
|
65
66
|
|
|
66
|
-
"@oxfmt/binding-linux-s390x-gnu": ["@oxfmt/binding-linux-s390x-gnu@0.
|
|
67
|
+
"@oxfmt/binding-linux-s390x-gnu": ["@oxfmt/binding-linux-s390x-gnu@0.72.0", "", { "os": "linux", "cpu": "s390x" }, "sha512-grW8HwEir+vK7fCcq1ZgL3NHQCfZ1PidiERE9Hbf+24xGys+DoDaoqTht4ccfn0PcBwbViLkwkda/KNpJu2KRQ=="],
|
|
67
68
|
|
|
68
|
-
"@oxfmt/binding-linux-x64-gnu": ["@oxfmt/binding-linux-x64-gnu@0.
|
|
69
|
+
"@oxfmt/binding-linux-x64-gnu": ["@oxfmt/binding-linux-x64-gnu@0.72.0", "", { "os": "linux", "cpu": "x64" }, "sha512-wQJRQfWBRIn88Pkr449EUViwRayrYUScg7ty+Ihiem21mQ9BUA6S9e/4RAgyNk9lMag0KBouyKskjq61rOC0WQ=="],
|
|
69
70
|
|
|
70
|
-
"@oxfmt/binding-linux-x64-musl": ["@oxfmt/binding-linux-x64-musl@0.
|
|
71
|
+
"@oxfmt/binding-linux-x64-musl": ["@oxfmt/binding-linux-x64-musl@0.72.0", "", { "os": "linux", "cpu": "x64" }, "sha512-T1B0uQzafxuGPjjaPrZJ497nxoi1BiI65JfsYc56nNpmev3msfb/iaTmH2kQuNFqa8PKxpMlf3GhWrWBvBPORQ=="],
|
|
71
72
|
|
|
72
|
-
"@oxfmt/binding-openharmony-arm64": ["@oxfmt/binding-openharmony-arm64@0.
|
|
73
|
+
"@oxfmt/binding-openharmony-arm64": ["@oxfmt/binding-openharmony-arm64@0.72.0", "", { "os": "none", "cpu": "arm64" }, "sha512-OKxxgTurl7+hypVplO8QRAbbQlwEs0j1Y6FZv+ZN2qNbdxQk2muMlzuJNBGTCWwxQ0rkkOD1uK/DW1fvzoUSJA=="],
|
|
73
74
|
|
|
74
|
-
"@oxfmt/binding-win32-arm64-msvc": ["@oxfmt/binding-win32-arm64-msvc@0.
|
|
75
|
+
"@oxfmt/binding-win32-arm64-msvc": ["@oxfmt/binding-win32-arm64-msvc@0.72.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-L78TKzURqvjuZOCo88ixMbPXf/RP7u31Y0cmjJ/KEmrHmfYhmhEvsDaTYPiyTRne64jUgCbADfY0YeoQk4/Xyw=="],
|
|
75
76
|
|
|
76
|
-
"@oxfmt/binding-win32-ia32-msvc": ["@oxfmt/binding-win32-ia32-msvc@0.
|
|
77
|
+
"@oxfmt/binding-win32-ia32-msvc": ["@oxfmt/binding-win32-ia32-msvc@0.72.0", "", { "os": "win32", "cpu": "ia32" }, "sha512-gQtFW+Ii8BWgtJTAD17TY/WsdNS5gUfAPov8iI1jeq4r9lRRYImmxPL08UU00/RLaCfBJwh2UgINnDY0iOiZ+A=="],
|
|
77
78
|
|
|
78
|
-
"@oxfmt/binding-win32-x64-msvc": ["@oxfmt/binding-win32-x64-msvc@0.
|
|
79
|
+
"@oxfmt/binding-win32-x64-msvc": ["@oxfmt/binding-win32-x64-msvc@0.72.0", "", { "os": "win32", "cpu": "x64" }, "sha512-uhooIN+DCzWX5uH7mQkSVCsODqsGluGJ4n3ch4+mITtWKpESMDjUJUSDBAVFuYQDwqY2McPDKdKJbM0oZVW/Qw=="],
|
|
79
80
|
|
|
80
|
-
"@oxlint/binding-android-arm-eabi": ["@oxlint/binding-android-arm-eabi@1.
|
|
81
|
+
"@oxlint/binding-android-arm-eabi": ["@oxlint/binding-android-arm-eabi@1.87.0", "", { "os": "android", "cpu": "arm" }, "sha512-22tVIHlB9898OYsBKmYB6He1MCSqdTmK1BVWuSNUTVrpS0KWNege+U9uEYqGJ+KatQag0r/oU44i3OOs46z7HQ=="],
|
|
81
82
|
|
|
82
|
-
"@oxlint/binding-android-arm64": ["@oxlint/binding-android-arm64@1.
|
|
83
|
+
"@oxlint/binding-android-arm64": ["@oxlint/binding-android-arm64@1.87.0", "", { "os": "android", "cpu": "arm64" }, "sha512-JfZQ3MWf74n8ov0DojZpkOduIubYJvZL5tbTMMhDutsal6u1xH1QuNpN+lK+EQwF8AeAfgwTR2fgh5U2br27XA=="],
|
|
83
84
|
|
|
84
|
-
"@oxlint/binding-darwin-arm64": ["@oxlint/binding-darwin-arm64@1.
|
|
85
|
+
"@oxlint/binding-darwin-arm64": ["@oxlint/binding-darwin-arm64@1.87.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-rkx6Xvvw93z2GImVOyvbZwAZcoY0Z6MJW177XNsSB+i/CBsH7ANyelTp01VZyIkM3iSXtqKVb4+ptBgPHap5pQ=="],
|
|
85
86
|
|
|
86
|
-
"@oxlint/binding-darwin-x64": ["@oxlint/binding-darwin-x64@1.
|
|
87
|
+
"@oxlint/binding-darwin-x64": ["@oxlint/binding-darwin-x64@1.87.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-cw5nYw7L/pQ2SgGBgOcg/Qo89llQre3vIc/kuBLhSICzu1r5s8L76H3ug6AIFsD98WpROj8/z5JVzkf4daxHaQ=="],
|
|
87
88
|
|
|
88
|
-
"@oxlint/binding-freebsd-x64": ["@oxlint/binding-freebsd-x64@1.
|
|
89
|
+
"@oxlint/binding-freebsd-x64": ["@oxlint/binding-freebsd-x64@1.87.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-x/SuznE6loRZK9gz9AS4ZmzNzSu+5KdeoCS+sVHhnrE8HM6AD8UyTjwldQTTqlXGvkwHASgB0NiTNOc3o3PdAg=="],
|
|
89
90
|
|
|
90
|
-
"@oxlint/binding-linux-arm-gnueabihf": ["@oxlint/binding-linux-arm-gnueabihf@1.
|
|
91
|
+
"@oxlint/binding-linux-arm-gnueabihf": ["@oxlint/binding-linux-arm-gnueabihf@1.87.0", "", { "os": "linux", "cpu": "arm" }, "sha512-+JEDmCAXiiFmKhAjZhgAOwaHWY6WENOQ5QA+lFuY59tgsUCDOTRi46B+lENK6CWvtxsXpwkZXNOgpjAQcpIpnA=="],
|
|
91
92
|
|
|
92
|
-
"@oxlint/binding-linux-arm-musleabihf": ["@oxlint/binding-linux-arm-musleabihf@1.
|
|
93
|
+
"@oxlint/binding-linux-arm-musleabihf": ["@oxlint/binding-linux-arm-musleabihf@1.87.0", "", { "os": "linux", "cpu": "arm" }, "sha512-/uC9XqXLAC9AHFLNycwmSQEvKqGrOCgU+uXALI7gNW0DG81TJ/3T2eHnKdRvcb5R1gFEfjxDwI4e4zIa29rICQ=="],
|
|
93
94
|
|
|
94
|
-
"@oxlint/binding-linux-arm64-gnu": ["@oxlint/binding-linux-arm64-gnu@1.
|
|
95
|
+
"@oxlint/binding-linux-arm64-gnu": ["@oxlint/binding-linux-arm64-gnu@1.87.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-FTRYPsBy/M728vnUv7l+KAwSAa3Qi4BQbhVvy7NYuMTZ0sUa/OWsbMx79HVFw6u/5KWcaYayDsoOiv7xbevzDg=="],
|
|
95
96
|
|
|
96
|
-
"@oxlint/binding-linux-arm64-musl": ["@oxlint/binding-linux-arm64-musl@1.
|
|
97
|
+
"@oxlint/binding-linux-arm64-musl": ["@oxlint/binding-linux-arm64-musl@1.87.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-6sC+N7IY0h1egd8SrYUGNN7CUyKJZ4bIZakKa7V7hfinf4jfi8Kq4+klJvFp5DqXcwMn44I5MeBwmJluO1odFg=="],
|
|
97
98
|
|
|
98
|
-
"@oxlint/binding-linux-ppc64-gnu": ["@oxlint/binding-linux-ppc64-gnu@1.
|
|
99
|
+
"@oxlint/binding-linux-ppc64-gnu": ["@oxlint/binding-linux-ppc64-gnu@1.87.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-d5Mnn+ICbhoJPi37Ccjy+86T5qfH2+mSTrTMBXNPfB+wqSWOayBBLLIrCXdUy1YssluCVdGkl+DO9w5r5ODmUA=="],
|
|
99
100
|
|
|
100
|
-
"@oxlint/binding-linux-riscv64-gnu": ["@oxlint/binding-linux-riscv64-gnu@1.
|
|
101
|
+
"@oxlint/binding-linux-riscv64-gnu": ["@oxlint/binding-linux-riscv64-gnu@1.87.0", "", { "os": "linux", "cpu": "none" }, "sha512-sf5YWuUo1Dx9loqWCgF8P278MycfcD4JHjDC/LV5j11L3Lqa4PFiwCjD6B8kP4AjsgZZkLn3xbpJEtZBaccs4Q=="],
|
|
101
102
|
|
|
102
|
-
"@oxlint/binding-linux-riscv64-musl": ["@oxlint/binding-linux-riscv64-musl@1.
|
|
103
|
+
"@oxlint/binding-linux-riscv64-musl": ["@oxlint/binding-linux-riscv64-musl@1.87.0", "", { "os": "linux", "cpu": "none" }, "sha512-+aCraYbmK3uU3P0rFojjeaK9pGY6JvBDXh/0CM+gPyWKmNmXmnFe0qj4qj02U4ibFpbd9Pa9CmDvIdjJUd29rA=="],
|
|
103
104
|
|
|
104
|
-
"@oxlint/binding-linux-s390x-gnu": ["@oxlint/binding-linux-s390x-gnu@1.
|
|
105
|
+
"@oxlint/binding-linux-s390x-gnu": ["@oxlint/binding-linux-s390x-gnu@1.87.0", "", { "os": "linux", "cpu": "s390x" }, "sha512-7rzbZQIljo6VLWVPqUyLa2P/WV3VFsJB4M52R4NCUJn1A50yjtUsHxiMHFL9opEKGFIiTbZ3VQzmtcJOPUq4NQ=="],
|
|
105
106
|
|
|
106
|
-
"@oxlint/binding-linux-x64-gnu": ["@oxlint/binding-linux-x64-gnu@1.
|
|
107
|
+
"@oxlint/binding-linux-x64-gnu": ["@oxlint/binding-linux-x64-gnu@1.87.0", "", { "os": "linux", "cpu": "x64" }, "sha512-Dry46Fa+AXE/xt9J/YriujU1pU9mzfNWHGQwtOYibAFH8HLrKWCi93AhIGnuUMiwn2JbuBkRyz51f50Ly4r4ow=="],
|
|
107
108
|
|
|
108
|
-
"@oxlint/binding-linux-x64-musl": ["@oxlint/binding-linux-x64-musl@1.
|
|
109
|
+
"@oxlint/binding-linux-x64-musl": ["@oxlint/binding-linux-x64-musl@1.87.0", "", { "os": "linux", "cpu": "x64" }, "sha512-f/HMZez74gJvnRpGz+b5sdGyWrEgRLmFTXg9sNoqjPWogGxYHUhXKTKyMiYsu9rUGR2ciYqL3fk+Ua4JhMJbRA=="],
|
|
109
110
|
|
|
110
|
-
"@oxlint/binding-openharmony-arm64": ["@oxlint/binding-openharmony-arm64@1.
|
|
111
|
+
"@oxlint/binding-openharmony-arm64": ["@oxlint/binding-openharmony-arm64@1.87.0", "", { "os": "none", "cpu": "arm64" }, "sha512-lEC6ZfPZm/07JlB7FsOWX9o1RiHlXiBW594LSUGuXmekC8LZmvUPP9XzE2WZcNxJi5cHA/Fw56o02c3JxgMA5g=="],
|
|
111
112
|
|
|
112
|
-
"@oxlint/binding-win32-arm64-msvc": ["@oxlint/binding-win32-arm64-msvc@1.
|
|
113
|
+
"@oxlint/binding-win32-arm64-msvc": ["@oxlint/binding-win32-arm64-msvc@1.87.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-afBWKOD36dUiA9AenaiWpCg8xfyUVPYznyAAVXu413brK4RA5UI/Xoc4yfeGIT8G1a44MV+JR7hioryerBDzGQ=="],
|
|
113
114
|
|
|
114
|
-
"@oxlint/binding-win32-ia32-msvc": ["@oxlint/binding-win32-ia32-msvc@1.
|
|
115
|
+
"@oxlint/binding-win32-ia32-msvc": ["@oxlint/binding-win32-ia32-msvc@1.87.0", "", { "os": "win32", "cpu": "ia32" }, "sha512-daptNsEOuru4/nJTxV4DBHNJ5GepzmaBVQf+jjgKQGi9NRlZKik+RFq4hUL7ewsF1pwjKM+SkYaMbF82UwFGnw=="],
|
|
115
116
|
|
|
116
|
-
"@oxlint/binding-win32-x64-msvc": ["@oxlint/binding-win32-x64-msvc@1.
|
|
117
|
+
"@oxlint/binding-win32-x64-msvc": ["@oxlint/binding-win32-x64-msvc@1.87.0", "", { "os": "win32", "cpu": "x64" }, "sha512-k+m/EShyXE29J/r1fjk0HlAzhN5JhIvj044oSJkXTEkCLrWZQgXb/3r4q5LTw/eaKW/4GuMXG2xmiJs3s5rPNw=="],
|
|
117
118
|
|
|
118
119
|
"@types/bun": ["@types/bun@1.4.2", "", { "dependencies": { "bun-types": "1.4.2" } }, "sha512-GimotNn7+ZV0uVArItBbriZsR1oNf0+WTzPkdcFrzShI7k2norL0uzEaJT8T33dWr7O/c9ZDuAFQrctKCi72oQ=="],
|
|
119
120
|
|
|
120
121
|
"@types/hast": ["@types/hast@3.0.5", "", { "dependencies": { "@types/unist": "*" } }, "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g=="],
|
|
121
122
|
|
|
122
|
-
"@types/node": ["@types/node@26.6.
|
|
123
|
+
"@types/node": ["@types/node@26.6.4", "", { "dependencies": { "undici-types": "~8.9.0" } }, "sha512-ldVPDCzj7fsaGZrLB0NuHuTvJcsNasysBAqMolr/cgxrLd1xbqxIr3XJiPnHHJUCxj5sNF1vnRj9aWnrVh5Jcg=="],
|
|
123
124
|
|
|
124
125
|
"@types/unist": ["@types/unist@3.0.3", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],
|
|
125
126
|
|
|
@@ -183,9 +184,9 @@
|
|
|
183
184
|
|
|
184
185
|
"lowlight": ["lowlight@3.1.0", "", { "dependencies": { "@types/hast": "^3.0.0", "devlop": "^1.0.0", "highlight.js": "~11.9.0" } }, "sha512-CEbNVoSikAxwDMDPjXlqlFYiZLkDJHwyGu/MfOsJnF3d7f3tds5J3z8s/l9TMXhzfsJCCJEAsD78842mwmg0PQ=="],
|
|
185
186
|
|
|
186
|
-
"oxfmt": ["oxfmt@0.
|
|
187
|
+
"oxfmt": ["oxfmt@0.72.0", "", { "dependencies": { "tinypool": "2.2.0" }, "optionalDependencies": { "@oxfmt/binding-android-arm-eabi": "0.72.0", "@oxfmt/binding-android-arm64": "0.72.0", "@oxfmt/binding-darwin-arm64": "0.72.0", "@oxfmt/binding-darwin-x64": "0.72.0", "@oxfmt/binding-freebsd-x64": "0.72.0", "@oxfmt/binding-linux-arm-gnueabihf": "0.72.0", "@oxfmt/binding-linux-arm-musleabihf": "0.72.0", "@oxfmt/binding-linux-arm64-gnu": "0.72.0", "@oxfmt/binding-linux-arm64-musl": "0.72.0", "@oxfmt/binding-linux-ppc64-gnu": "0.72.0", "@oxfmt/binding-linux-riscv64-gnu": "0.72.0", "@oxfmt/binding-linux-riscv64-musl": "0.72.0", "@oxfmt/binding-linux-s390x-gnu": "0.72.0", "@oxfmt/binding-linux-x64-gnu": "0.72.0", "@oxfmt/binding-linux-x64-musl": "0.72.0", "@oxfmt/binding-openharmony-arm64": "0.72.0", "@oxfmt/binding-win32-arm64-msvc": "0.72.0", "@oxfmt/binding-win32-ia32-msvc": "0.72.0", "@oxfmt/binding-win32-x64-msvc": "0.72.0" }, "peerDependencies": { "svelte": "^5.0.0", "vite-plus": "*" }, "optionalPeers": ["svelte", "vite-plus"], "bin": { "oxfmt": "bin/oxfmt" } }, "sha512-16OQeL0uhPZbfmT9S9WWM0Nv9+BmVi8Ra1uTYaSKj/qSCs6FB30KOhz9JoNYw6thT+K5bVxsk/tSEOu497i34g=="],
|
|
187
188
|
|
|
188
|
-
"oxlint": ["oxlint@1.
|
|
189
|
+
"oxlint": ["oxlint@1.87.0", "", { "optionalDependencies": { "@oxlint/binding-android-arm-eabi": "1.87.0", "@oxlint/binding-android-arm64": "1.87.0", "@oxlint/binding-darwin-arm64": "1.87.0", "@oxlint/binding-darwin-x64": "1.87.0", "@oxlint/binding-freebsd-x64": "1.87.0", "@oxlint/binding-linux-arm-gnueabihf": "1.87.0", "@oxlint/binding-linux-arm-musleabihf": "1.87.0", "@oxlint/binding-linux-arm64-gnu": "1.87.0", "@oxlint/binding-linux-arm64-musl": "1.87.0", "@oxlint/binding-linux-ppc64-gnu": "1.87.0", "@oxlint/binding-linux-riscv64-gnu": "1.87.0", "@oxlint/binding-linux-riscv64-musl": "1.87.0", "@oxlint/binding-linux-s390x-gnu": "1.87.0", "@oxlint/binding-linux-x64-gnu": "1.87.0", "@oxlint/binding-linux-x64-musl": "1.87.0", "@oxlint/binding-openharmony-arm64": "1.87.0", "@oxlint/binding-win32-arm64-msvc": "1.87.0", "@oxlint/binding-win32-ia32-msvc": "1.87.0", "@oxlint/binding-win32-x64-msvc": "1.87.0" }, "peerDependencies": { "oxlint-tsgolint": ">=7.0.2003", "vite-plus": "*" }, "optionalPeers": ["oxlint-tsgolint", "vite-plus"], "bin": { "oxlint": "bin/oxlint" } }, "sha512-drxVlaW7Oqq7wSy1CN25znRu00aRq8n57Q2wniJRxCmtYVz07ufCm7EVDPQFZURrTgQIjzKrVEHAD/HcvJXObg=="],
|
|
189
190
|
|
|
190
191
|
"prettier": ["prettier@3.9.9", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-Z/CJHIkdujO/OtN7nXUii0Rf3VT5SRuhjBA82Xvu2XhBUgX3nhP67T0LHceBdQLex7OOFGTox+Q5Yg8Jk2Qivg=="],
|
|
191
192
|
|
|
@@ -5,44 +5,113 @@ Feature: IO commands
|
|
|
5
5
|
|
|
6
6
|
Scenario: list shows a file that was written
|
|
7
7
|
Given a file "a.txt" containing "hello" in the working directory
|
|
8
|
-
When the executable stdout is captured for "list {workdir}"
|
|
8
|
+
When the executable stdout is captured for "list --location.protocol=file --location.file.path={workdir}"
|
|
9
9
|
Then the captured process should complete with exit code 0
|
|
10
10
|
And the stdout should contain "a.txt"
|
|
11
11
|
|
|
12
12
|
Scenario: get-properties reports size
|
|
13
13
|
Given a file "a.txt" containing "hello" in the working directory
|
|
14
|
-
When the executable stdout is captured for "get-properties {workdir}
|
|
14
|
+
When the executable stdout is captured for "get-properties --location.protocol=file --location.file.path={workdir} --location.file.filename=a.txt"
|
|
15
15
|
Then the captured process should complete with exit code 0
|
|
16
16
|
And the stdout should contain '"size": 5'
|
|
17
17
|
|
|
18
18
|
Scenario: set-properties reports success
|
|
19
19
|
Given a file "a.txt" containing "hello" in the working directory
|
|
20
|
-
When the executable stdout is captured for "set-properties {workdir}
|
|
20
|
+
When the executable stdout is captured for "set-properties --location.protocol=file --location.file.path={workdir} --location.file.filename=a.txt --properties.file.mode=420"
|
|
21
21
|
Then the captured process should complete with exit code 0
|
|
22
22
|
And the stdout should contain "Updated properties"
|
|
23
23
|
|
|
24
24
|
Scenario: copy duplicates a file, leaving the original in place
|
|
25
25
|
Given a file "a.txt" containing "hello" in the working directory
|
|
26
|
-
When the executable stdout is captured for "copy {workdir}
|
|
26
|
+
When the executable stdout is captured for "copy --source.protocol=file --source.file.path={workdir} --source.file.filename=a.txt --dest.protocol=file --dest.file.path={workdir} --dest.file.filename=b.txt"
|
|
27
27
|
Then the captured process should complete with exit code 0
|
|
28
28
|
And a file "b.txt" should exist in the working directory
|
|
29
29
|
And a file "a.txt" should exist in the working directory
|
|
30
|
+
And the stdout should contain "path: file/js -> file/js"
|
|
30
31
|
|
|
31
32
|
Scenario: move relocates a file
|
|
32
33
|
Given a file "a.txt" containing "hello" in the working directory
|
|
33
|
-
When the executable stdout is captured for "move {workdir}
|
|
34
|
+
When the executable stdout is captured for "move --source.protocol=file --source.file.path={workdir} --source.file.filename=a.txt --dest.protocol=file --dest.file.path={workdir} --dest.file.filename=c.txt"
|
|
34
35
|
Then the captured process should complete with exit code 0
|
|
35
36
|
And a file "c.txt" should exist in the working directory
|
|
36
37
|
And a file "a.txt" should not exist in the working directory
|
|
37
38
|
|
|
38
39
|
Scenario: delete removes a file
|
|
39
40
|
Given a file "a.txt" containing "hello" in the working directory
|
|
40
|
-
When the executable stdout is captured for "delete {workdir}
|
|
41
|
+
When the executable stdout is captured for "delete --location.protocol=file --location.file.path={workdir} --location.file.filename=a.txt"
|
|
41
42
|
Then the captured process should complete with exit code 0
|
|
42
43
|
And a file "a.txt" should not exist in the working directory
|
|
43
44
|
|
|
44
45
|
Scenario: hash outputs the expected sha256 digest
|
|
45
46
|
Given a file "a.txt" containing "hello" in the working directory
|
|
46
|
-
When the executable stdout is captured for "hash {workdir}
|
|
47
|
+
When the executable stdout is captured for "hash --location.protocol=file --location.file.path={workdir} --location.file.filename=a.txt"
|
|
47
48
|
Then the captured process should complete with exit code 0
|
|
48
49
|
And the stdout should contain "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824"
|
|
50
|
+
|
|
51
|
+
Scenario: copy with a pattern copies only the matching files
|
|
52
|
+
Given a file "a.txt" containing "hello" in the working directory
|
|
53
|
+
And a file "b.log" containing "hello" in the working directory
|
|
54
|
+
And a folder "out" in the working directory
|
|
55
|
+
When the executable stdout is captured for "copy --source.protocol=file --source.file.path={workdir} --source.file.pattern=*.txt --dest.protocol=file --dest.file.path={workdir}/out"
|
|
56
|
+
Then the captured process should complete with exit code 0
|
|
57
|
+
And a file "out/a.txt" should exist in the working directory
|
|
58
|
+
And a file "out/b.log" should not exist in the working directory
|
|
59
|
+
|
|
60
|
+
Scenario: list recursive descends into sub folders
|
|
61
|
+
Given a folder "sub" in the working directory
|
|
62
|
+
And a file "sub/c.log" containing "hello" in the working directory
|
|
63
|
+
When the executable stdout is captured for "list --location.protocol=file --location.file.path={workdir} --recursive"
|
|
64
|
+
Then the captured process should complete with exit code 0
|
|
65
|
+
And the stdout should contain "sub/c.log"
|
|
66
|
+
|
|
67
|
+
Scenario: list with a regex only shows the matching items
|
|
68
|
+
Given a file "a.txt" containing "hello" in the working directory
|
|
69
|
+
And a file "b.log" containing "hello" in the working directory
|
|
70
|
+
When the executable stdout is captured for "list --location.protocol=file --location.file.path={workdir} --regex=log$"
|
|
71
|
+
Then the captured process should complete with exit code 0
|
|
72
|
+
And the stdout should contain "b.log"
|
|
73
|
+
And the stdout should not contain "a.txt"
|
|
74
|
+
|
|
75
|
+
Scenario: hash outputs the expected md5 digest
|
|
76
|
+
Given a file "a.txt" containing "hello" in the working directory
|
|
77
|
+
When the executable stdout is captured for "hash --location.protocol=file --location.file.path={workdir} --location.file.filename=a.txt --algorithm=md5"
|
|
78
|
+
Then the captured process should complete with exit code 0
|
|
79
|
+
And the stdout should contain "5d41402abc4b2a76b9719d911017c592"
|
|
80
|
+
|
|
81
|
+
Scenario: get-properties fails for a missing file
|
|
82
|
+
When the executable stdout is captured for "get-properties --location.protocol=file --location.file.path={workdir} --location.file.filename=missing.txt"
|
|
83
|
+
Then the captured process should complete with exit code 3
|
|
84
|
+
And the stderr should contain "no such file or directory"
|
|
85
|
+
|
|
86
|
+
Scenario: delete fails for a missing file
|
|
87
|
+
When the executable stdout is captured for "delete --location.protocol=file --location.file.path={workdir} --location.file.filename=missing.txt"
|
|
88
|
+
Then the captured process should complete with exit code 3
|
|
89
|
+
And the stderr should contain "no such file or directory"
|
|
90
|
+
|
|
91
|
+
Scenario: copy fails for a missing source and creates no destination
|
|
92
|
+
When the executable stdout is captured for "copy --source.protocol=file --source.file.path={workdir} --source.file.filename=missing.txt --dest.protocol=file --dest.file.path={workdir} --dest.file.filename=b.txt"
|
|
93
|
+
Then the captured process should complete with exit code 3
|
|
94
|
+
And the stderr should contain "no such file or directory"
|
|
95
|
+
And a file "b.txt" should not exist in the working directory
|
|
96
|
+
|
|
97
|
+
Scenario: list rejects a single file location
|
|
98
|
+
Given a file "a.txt" containing "hello" in the working directory
|
|
99
|
+
When the executable stdout is captured for "list --location.protocol=file --location.file.path={workdir} --location.file.filename=a.txt"
|
|
100
|
+
Then the captured process should complete with exit code 3
|
|
101
|
+
And the stderr should contain "list needs a folder or pattern location"
|
|
102
|
+
|
|
103
|
+
Scenario: hash rejects a folder location
|
|
104
|
+
When the executable stdout is captured for "hash --location.protocol=file --location.file.path={workdir}"
|
|
105
|
+
Then the captured process should complete with exit code 3
|
|
106
|
+
And the stderr should contain "hash needs a single entry location"
|
|
107
|
+
|
|
108
|
+
Scenario: an unknown location protocol is rejected
|
|
109
|
+
When the executable stdout is captured for "list --location.protocol=bogus --location.file.path={workdir}"
|
|
110
|
+
Then the captured process should complete with exit code 1
|
|
111
|
+
And the stderr should contain "illegal value"
|
|
112
|
+
|
|
113
|
+
Scenario: an unknown hash algorithm is rejected
|
|
114
|
+
Given a file "a.txt" containing "hello" in the working directory
|
|
115
|
+
When the executable stdout is captured for "hash --location.protocol=file --location.file.path={workdir} --location.file.filename=a.txt --algorithm=crc"
|
|
116
|
+
Then the captured process should complete with exit code 1
|
|
117
|
+
And the stderr should contain "illegal value"
|
|
@@ -42,3 +42,9 @@ def step_impl(context, text):
|
|
|
42
42
|
text = text.replace('\\n', '\n')
|
|
43
43
|
assert text in context.subprocess_wrapper.stderr, \
|
|
44
44
|
'expected {!r} in stderr {!r}'.format(text, context.subprocess_wrapper.stderr)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
@then('the stdout should not contain "{text}"')
|
|
48
|
+
def step_impl(context, text):
|
|
49
|
+
assert text not in context.subprocess_wrapper.stdout, \
|
|
50
|
+
'expected {!r} not in stdout {!r}'.format(text, context.subprocess_wrapper.stdout)
|
|
@@ -15,6 +15,11 @@ def step_impl(context, name, content):
|
|
|
15
15
|
f.write(content)
|
|
16
16
|
|
|
17
17
|
|
|
18
|
+
@given('a folder "{name}" in the working directory')
|
|
19
|
+
def step_impl(context, name):
|
|
20
|
+
os.mkdir(os.path.join(context.workdir, name))
|
|
21
|
+
|
|
22
|
+
|
|
18
23
|
@then('a file "{name}" should exist in the working directory')
|
|
19
24
|
def step_impl(context, name):
|
|
20
25
|
path = os.path.join(context.workdir, name)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flowscripter/flowscripter-io-cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "CLI for https://github.com/flowscripter/pluggable-io-framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bun",
|
|
@@ -21,19 +21,20 @@
|
|
|
21
21
|
"access": "public"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@flowscripter/dynamic-cli-framework": "^
|
|
25
|
-
"@flowscripter/dynamic-cli-framework-api": "^
|
|
26
|
-
"@flowscripter/dynamic-plugin-framework": "^2.2.
|
|
27
|
-
"@flowscripter/flowscripter-io-cli-hash-native": "^1.0.
|
|
28
|
-
"@flowscripter/pluggable-io-framework": "^1.
|
|
29
|
-
"@flowscripter/pluggable-io-framework-api": "^1.1
|
|
24
|
+
"@flowscripter/dynamic-cli-framework": "^9.0.0",
|
|
25
|
+
"@flowscripter/dynamic-cli-framework-api": "^5.0.0",
|
|
26
|
+
"@flowscripter/dynamic-plugin-framework": "^2.2.19",
|
|
27
|
+
"@flowscripter/flowscripter-io-cli-hash-native": "^1.0.13",
|
|
28
|
+
"@flowscripter/pluggable-io-framework": "^2.1.0",
|
|
29
|
+
"@flowscripter/pluggable-io-framework-api": "^3.1.1",
|
|
30
|
+
"zod": "^4.6.5"
|
|
30
31
|
},
|
|
31
32
|
"devDependencies": {
|
|
32
|
-
"@flowscripter/io-plugin-filesystem": "^
|
|
33
|
+
"@flowscripter/io-plugin-filesystem": "^2.0.2",
|
|
33
34
|
"@types/bun": "^1.4.2",
|
|
34
|
-
"@types/node": "^26.6.
|
|
35
|
-
"oxfmt": "0.
|
|
36
|
-
"oxlint": "1.
|
|
35
|
+
"@types/node": "^26.6.4",
|
|
36
|
+
"oxfmt": "0.72.0",
|
|
37
|
+
"oxlint": "1.87.0"
|
|
37
38
|
},
|
|
38
39
|
"peerDependencies": {
|
|
39
40
|
"typescript": "^7.0.2"
|
package/src/cli.ts
CHANGED
|
@@ -4,17 +4,18 @@ import {
|
|
|
4
4
|
SyntaxHighlighterServiceProvider,
|
|
5
5
|
launchMultiCommandCLI,
|
|
6
6
|
} from "@flowscripter/dynamic-cli-framework";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
7
|
+
import { createCopyCommand } from "./commands/copy.ts";
|
|
8
|
+
import { createDeleteCommand } from "./commands/delete.ts";
|
|
9
|
+
import { createGetPropertiesCommand } from "./commands/get-properties.ts";
|
|
10
|
+
import { createHashCommand } from "./commands/hash.ts";
|
|
11
|
+
import { createListCommand } from "./commands/list.ts";
|
|
12
|
+
import { createMoveCommand } from "./commands/move.ts";
|
|
13
|
+
import { createSetPropertiesCommand } from "./commands/set-properties.ts";
|
|
14
14
|
import {
|
|
15
15
|
PLUGGABLE_IO_FRAMEWORK_PACKAGE_JSON_NAMESPACE,
|
|
16
16
|
getPluginsNodeModulesPath,
|
|
17
|
-
} from "./pluginsDir.ts";
|
|
17
|
+
} from "./util/pluginsDir.ts";
|
|
18
|
+
import { createProviderRegistry } from "./util/providerRegistry.ts";
|
|
18
19
|
import packageJson from "../package.json";
|
|
19
20
|
|
|
20
21
|
export function getCLIFeatureOptions(): BaseCLIFeatureOptions {
|
|
@@ -37,8 +38,17 @@ export function getCLIFeatureOptions(): BaseCLIFeatureOptions {
|
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
export async function cli(): Promise<void> {
|
|
41
|
+
const registry = await createProviderRegistry();
|
|
40
42
|
await launchMultiCommandCLI(
|
|
41
|
-
[
|
|
43
|
+
[
|
|
44
|
+
createListCommand(registry),
|
|
45
|
+
createGetPropertiesCommand(registry),
|
|
46
|
+
createSetPropertiesCommand(registry),
|
|
47
|
+
createDeleteCommand(registry),
|
|
48
|
+
createCopyCommand(registry),
|
|
49
|
+
createMoveCommand(registry),
|
|
50
|
+
createHashCommand(registry),
|
|
51
|
+
],
|
|
42
52
|
"Example CLI for pluggable-io-framework.",
|
|
43
53
|
"flowscripter-io-cli",
|
|
44
54
|
packageJson.version,
|