@fnndsc/brasa 0.56.2 → 0.56.4
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/buildinfo.json +1 -1
- package/dist/builtins/berth/berth.d.ts +11 -0
- package/dist/builtins/berth/berth.js +53 -22
- package/dist/builtins/berth/berth.js.map +1 -1
- package/dist/builtins/berth/berthCube.d.ts +17 -2
- package/dist/builtins/berth/berthCube.js +22 -10
- package/dist/builtins/berth/berthCube.js.map +1 -1
- package/dist/builtins/debug.d.ts +24 -3
- package/dist/builtins/debug.js +66 -13
- package/dist/builtins/debug.js.map +1 -1
- package/dist/builtins/fs/acl.args.d.ts +5 -38
- package/dist/builtins/fs/acl.args.js +6 -72
- package/dist/builtins/fs/acl.args.js.map +1 -1
- package/dist/builtins/fs/acl.d.ts +100 -10
- package/dist/builtins/fs/acl.js +222 -68
- package/dist/builtins/fs/acl.js.map +1 -1
- package/dist/builtins/fs/cat.args.d.ts +14 -15
- package/dist/builtins/fs/cat.args.js +13 -40
- package/dist/builtins/fs/cat.args.js.map +1 -1
- package/dist/builtins/fs/cat.d.ts +40 -3
- package/dist/builtins/fs/cat.js +89 -10
- package/dist/builtins/fs/cat.js.map +1 -1
- package/dist/builtins/fs/cd.d.ts +24 -6
- package/dist/builtins/fs/cd.js +71 -18
- package/dist/builtins/fs/cd.js.map +1 -1
- package/dist/builtins/fs/configWrite.d.ts +24 -8
- package/dist/builtins/fs/configWrite.js +77 -36
- package/dist/builtins/fs/configWrite.js.map +1 -1
- package/dist/builtins/fs/cp.d.ts +39 -4
- package/dist/builtins/fs/cp.js +120 -55
- package/dist/builtins/fs/cp.js.map +1 -1
- package/dist/builtins/fs/download.d.ts +12 -1
- package/dist/builtins/fs/download.js +24 -4
- package/dist/builtins/fs/download.js.map +1 -1
- package/dist/builtins/fs/du.d.ts +59 -33
- package/dist/builtins/fs/du.js +111 -79
- package/dist/builtins/fs/du.js.map +1 -1
- package/dist/builtins/fs/edit.d.ts +19 -4
- package/dist/builtins/fs/edit.js +77 -16
- package/dist/builtins/fs/edit.js.map +1 -1
- package/dist/builtins/fs/find.d.ts +25 -0
- package/dist/builtins/fs/find.js +76 -5
- package/dist/builtins/fs/find.js.map +1 -1
- package/dist/builtins/fs/mkdir.d.ts +28 -18
- package/dist/builtins/fs/mkdir.js +95 -66
- package/dist/builtins/fs/mkdir.js.map +1 -1
- package/dist/builtins/fs/mv.d.ts +34 -4
- package/dist/builtins/fs/mv.js +129 -64
- package/dist/builtins/fs/mv.js.map +1 -1
- package/dist/builtins/fs/pull.args.d.ts +56 -17
- package/dist/builtins/fs/pull.args.js +16 -66
- package/dist/builtins/fs/pull.args.js.map +1 -1
- package/dist/builtins/fs/pull.d.ts +62 -0
- package/dist/builtins/fs/pull.js +86 -22
- package/dist/builtins/fs/pull.js.map +1 -1
- package/dist/builtins/fs/pwd.d.ts +19 -5
- package/dist/builtins/fs/pwd.js +62 -8
- package/dist/builtins/fs/pwd.js.map +1 -1
- package/dist/builtins/fs/rm.d.ts +58 -21
- package/dist/builtins/fs/rm.js +99 -82
- package/dist/builtins/fs/rm.js.map +1 -1
- package/dist/builtins/fs/rmdir.d.ts +29 -11
- package/dist/builtins/fs/rmdir.js +87 -36
- package/dist/builtins/fs/rmdir.js.map +1 -1
- package/dist/builtins/fs/touch.d.ts +44 -9
- package/dist/builtins/fs/touch.js +91 -27
- package/dist/builtins/fs/touch.js.map +1 -1
- package/dist/builtins/fs/transferJobs.d.ts +64 -0
- package/dist/builtins/fs/transferJobs.js +98 -0
- package/dist/builtins/fs/transferJobs.js.map +1 -0
- package/dist/builtins/fs/tree.d.ts +36 -9
- package/dist/builtins/fs/tree.js +126 -36
- package/dist/builtins/fs/tree.js.map +1 -1
- package/dist/builtins/fs/upload.d.ts +35 -3
- package/dist/builtins/fs/upload.js +99 -14
- package/dist/builtins/fs/upload.js.map +1 -1
- package/dist/builtins/fs/xattr.args.d.ts +12 -33
- package/dist/builtins/fs/xattr.args.js +17 -95
- package/dist/builtins/fs/xattr.args.js.map +1 -1
- package/dist/builtins/fs/xattr.d.ts +98 -8
- package/dist/builtins/fs/xattr.js +163 -24
- package/dist/builtins/fs/xattr.js.map +1 -1
- package/dist/builtins/games/bytes.d.ts +201 -5
- package/dist/builtins/games/bytes.js +255 -54
- package/dist/builtins/games/bytes.js.map +1 -1
- package/dist/builtins/games/chimes.d.ts +180 -3
- package/dist/builtins/games/chimes.js +203 -26
- package/dist/builtins/games/chimes.js.map +1 -1
- package/dist/builtins/games/chrislab.d.ts +101 -3
- package/dist/builtins/games/chrislab.js +117 -17
- package/dist/builtins/games/chrislab.js.map +1 -1
- package/dist/builtins/games/cowsay.d.ts +93 -2
- package/dist/builtins/games/cowsay.js +90 -31
- package/dist/builtins/games/cowsay.js.map +1 -1
- package/dist/builtins/games/figlet.d.ts +70 -2
- package/dist/builtins/games/figlet.js +83 -6
- package/dist/builtins/games/figlet.js.map +1 -1
- package/dist/builtins/games/lab.d.ts +104 -5
- package/dist/builtins/games/lab.js +144 -6
- package/dist/builtins/games/lab.js.map +1 -1
- package/dist/builtins/games/lolcat.d.ts +61 -1
- package/dist/builtins/games/lolcat.js +59 -24
- package/dist/builtins/games/lolcat.js.map +1 -1
- package/dist/builtins/games/morse.d.ts +36 -1
- package/dist/builtins/games/morse.js +50 -2
- package/dist/builtins/games/morse.js.map +1 -1
- package/dist/builtins/games/numbers.d.ts +241 -5
- package/dist/builtins/games/numbers.js +298 -23
- package/dist/builtins/games/numbers.js.map +1 -1
- package/dist/builtins/games/play.d.ts +96 -6
- package/dist/builtins/games/play.js +137 -6
- package/dist/builtins/games/play.js.map +1 -1
- package/dist/builtins/games/qr.d.ts +40 -1
- package/dist/builtins/games/qr.js +51 -2
- package/dist/builtins/games/qr.js.map +1 -1
- package/dist/builtins/games/show.d.ts +131 -6
- package/dist/builtins/games/show.js +208 -20
- package/dist/builtins/games/show.js.map +1 -1
- package/dist/builtins/games/sky.d.ts +178 -4
- package/dist/builtins/games/sky.js +228 -12
- package/dist/builtins/games/sky.js.map +1 -1
- package/dist/builtins/games/text.d.ts +258 -7
- package/dist/builtins/games/text.js +310 -29
- package/dist/builtins/games/text.js.map +1 -1
- package/dist/builtins/games/trek.d.ts +67 -3
- package/dist/builtins/games/trek.js +63 -10
- package/dist/builtins/games/trek.js.map +1 -1
- package/dist/builtins/games/wtf.d.ts +58 -1
- package/dist/builtins/games/wtf.js +67 -6
- package/dist/builtins/games/wtf.js.map +1 -1
- package/dist/builtins/help.d.ts +38 -2
- package/dist/builtins/help.js +76 -769
- package/dist/builtins/help.js.map +1 -1
- package/dist/builtins/helpSections.js +4 -1
- package/dist/builtins/helpSections.js.map +1 -1
- package/dist/builtins/net/connect.d.ts +36 -3
- package/dist/builtins/net/connect.js +84 -26
- package/dist/builtins/net/connect.js.map +1 -1
- package/dist/builtins/net/cubepath.d.ts +49 -5
- package/dist/builtins/net/cubepath.js +69 -27
- package/dist/builtins/net/cubepath.js.map +1 -1
- package/dist/builtins/net/logout.d.ts +13 -4
- package/dist/builtins/net/logout.js +49 -3
- package/dist/builtins/net/logout.js.map +1 -1
- package/dist/builtins/net/netstat.d.ts +29 -4
- package/dist/builtins/net/netstat.js +64 -23
- package/dist/builtins/net/netstat.js.map +1 -1
- package/dist/builtins/net/pacs.d.ts +169 -15
- package/dist/builtins/net/pacs.js +92 -33
- package/dist/builtins/net/pacs.js.map +1 -1
- package/dist/builtins/net/query.args.d.ts +95 -0
- package/dist/builtins/net/query.args.js +26 -0
- package/dist/builtins/net/query.args.js.map +1 -0
- package/dist/builtins/net/query.d.ts +98 -5
- package/dist/builtins/net/query.js +89 -83
- package/dist/builtins/net/query.js.map +1 -1
- package/dist/builtins/net/status.d.ts +5 -3
- package/dist/builtins/net/status.js +5 -12
- package/dist/builtins/net/status.js.map +1 -1
- package/dist/builtins/parametersofplugin.d.ts +82 -3
- package/dist/builtins/parametersofplugin.js +79 -23
- package/dist/builtins/parametersofplugin.js.map +1 -1
- package/dist/builtins/proc.d.ts +210 -3
- package/dist/builtins/proc.js +210 -119
- package/dist/builtins/proc.js.map +1 -1
- package/dist/builtins/res/compute.d.ts +67 -3
- package/dist/builtins/res/compute.js +121 -35
- package/dist/builtins/res/compute.js.map +1 -1
- package/dist/builtins/res/dicom.d.ts +52 -3
- package/dist/builtins/res/dicom.js +82 -34
- package/dist/builtins/res/dicom.js.map +1 -1
- package/dist/builtins/res/expect.d.ts +52 -3
- package/dist/builtins/res/expect.js +92 -29
- package/dist/builtins/res/expect.js.map +1 -1
- package/dist/builtins/res/feed.d.ts +475 -3
- package/dist/builtins/res/feed.js +253 -158
- package/dist/builtins/res/feed.js.map +1 -1
- package/dist/builtins/res/files.d.ts +517 -3
- package/dist/builtins/res/files.js +124 -44
- package/dist/builtins/res/files.js.map +1 -1
- package/dist/builtins/res/gather.d.ts +113 -3
- package/dist/builtins/res/gather.js +153 -44
- package/dist/builtins/res/gather.js.map +1 -1
- package/dist/builtins/res/gather.process.d.ts +27 -19
- package/dist/builtins/res/gather.process.js +29 -59
- package/dist/builtins/res/gather.process.js.map +1 -1
- package/dist/builtins/res/group.d.ts +284 -3
- package/dist/builtins/res/group.js +147 -76
- package/dist/builtins/res/group.js.map +1 -1
- package/dist/builtins/res/image.d.ts +30 -2
- package/dist/builtins/res/image.js +62 -10
- package/dist/builtins/res/image.js.map +1 -1
- package/dist/builtins/res/play.d.ts +71 -9
- package/dist/builtins/res/play.js +124 -82
- package/dist/builtins/res/play.js.map +1 -1
- package/dist/builtins/res/plugininstance.d.ts +307 -2
- package/dist/builtins/res/plugininstance.js +122 -50
- package/dist/builtins/res/plugininstance.js.map +1 -1
- package/dist/builtins/res/pluginmeta.d.ts +244 -2
- package/dist/builtins/res/pluginmeta.js +98 -40
- package/dist/builtins/res/pluginmeta.js.map +1 -1
- package/dist/builtins/res/record.d.ts +37 -3
- package/dist/builtins/res/record.js +127 -57
- package/dist/builtins/res/record.js.map +1 -1
- package/dist/builtins/res/resourceList.d.ts +136 -0
- package/dist/builtins/res/resourceList.js +51 -0
- package/dist/builtins/res/resourceList.js.map +1 -0
- package/dist/builtins/res/tag.d.ts +244 -3
- package/dist/builtins/res/tag.js +97 -41
- package/dist/builtins/res/tag.js.map +1 -1
- package/dist/builtins/res/user.d.ts +122 -3
- package/dist/builtins/res/user.js +83 -21
- package/dist/builtins/res/user.js.map +1 -1
- package/dist/builtins/res/workflow.d.ts +244 -2
- package/dist/builtins/res/workflow.js +97 -40
- package/dist/builtins/res/workflow.js.map +1 -1
- package/dist/builtins/store.d.ts +85 -3
- package/dist/builtins/store.js +135 -68
- package/dist/builtins/store.js.map +1 -1
- package/dist/builtins/sys/apropos.d.ts +80 -5
- package/dist/builtins/sys/apropos.js +121 -15
- package/dist/builtins/sys/apropos.js.map +1 -1
- package/dist/builtins/sys/cal.d.ts +44 -5
- package/dist/builtins/sys/cal.js +57 -10
- package/dist/builtins/sys/cal.js.map +1 -1
- package/dist/builtins/sys/command.d.ts +20 -0
- package/dist/builtins/sys/command.js +31 -0
- package/dist/builtins/sys/command.js.map +1 -1
- package/dist/builtins/sys/context.d.ts +13 -3
- package/dist/builtins/sys/context.js +51 -4
- package/dist/builtins/sys/context.js.map +1 -1
- package/dist/builtins/sys/date.d.ts +56 -5
- package/dist/builtins/sys/date.js +63 -9
- package/dist/builtins/sys/date.js.map +1 -1
- package/dist/builtins/sys/echo.d.ts +63 -2
- package/dist/builtins/sys/echo.js +87 -8
- package/dist/builtins/sys/echo.js.map +1 -1
- package/dist/builtins/sys/fortune.d.ts +27 -2
- package/dist/builtins/sys/fortune.js +44 -2
- package/dist/builtins/sys/fortune.js.map +1 -1
- package/dist/builtins/sys/grep.d.ts +245 -11
- package/dist/builtins/sys/grep.js +418 -131
- package/dist/builtins/sys/grep.js.map +1 -1
- package/dist/builtins/sys/joblets.d.ts +66 -7
- package/dist/builtins/sys/joblets.js +101 -14
- package/dist/builtins/sys/joblets.js.map +1 -1
- package/dist/builtins/sys/motd.d.ts +37 -3
- package/dist/builtins/sys/motd.js +49 -8
- package/dist/builtins/sys/motd.js.map +1 -1
- package/dist/builtins/sys/notes.d.ts +75 -3
- package/dist/builtins/sys/notes.js +90 -29
- package/dist/builtins/sys/notes.js.map +1 -1
- package/dist/builtins/sys/physicalmode.d.ts +24 -3
- package/dist/builtins/sys/physicalmode.js +68 -14
- package/dist/builtins/sys/physicalmode.js.map +1 -1
- package/dist/builtins/sys/tasks.d.ts +74 -5
- package/dist/builtins/sys/tasks.js +102 -14
- package/dist/builtins/sys/tasks.js.map +1 -1
- package/dist/builtins/sys/textFilters.d.ts +673 -41
- package/dist/builtins/sys/textFilters.js +718 -263
- package/dist/builtins/sys/textFilters.js.map +1 -1
- package/dist/builtins/sys/timing.d.ts +24 -3
- package/dist/builtins/sys/timing.js +67 -14
- package/dist/builtins/sys/timing.js.map +1 -1
- package/dist/builtins/sys/variables.d.ts +70 -4
- package/dist/builtins/sys/variables.js +103 -31
- package/dist/builtins/sys/variables.js.map +1 -1
- package/dist/builtins/sys/version.d.ts +27 -2
- package/dist/builtins/sys/version.js +48 -3
- package/dist/builtins/sys/version.js.map +1 -1
- package/dist/builtins/sys/weather.d.ts +92 -15
- package/dist/builtins/sys/weather.js +71 -45
- package/dist/builtins/sys/weather.js.map +1 -1
- package/dist/builtins/sys/whoami.d.ts +38 -18
- package/dist/builtins/sys/whoami.js +112 -8
- package/dist/builtins/sys/whoami.js.map +1 -1
- package/dist/builtins/utils.d.ts +0 -37
- package/dist/builtins/utils.js +0 -86
- package/dist/builtins/utils.js.map +1 -1
- package/dist/chris/chrisCommands.js +58 -152
- package/dist/chris/chrisCommands.js.map +1 -1
- package/dist/chris/commandFallback.d.ts +12 -0
- package/dist/chris/commandFallback.js +47 -0
- package/dist/chris/commandFallback.js.map +1 -1
- package/dist/chris/filesystem.js +7 -5
- package/dist/chris/filesystem.js.map +1 -1
- package/dist/chris/help.js +0 -1018
- package/dist/chris/help.js.map +1 -1
- package/dist/chris/kinds.d.ts +21 -0
- package/dist/chris/kinds.js +114 -2
- package/dist/chris/kinds.js.map +1 -1
- package/dist/chris/mounts.d.ts +4 -4
- package/dist/chris/mounts.js +9 -16
- package/dist/chris/mounts.js.map +1 -1
- package/dist/chris/navigation.d.ts +2 -3
- package/dist/chris/navigation.js +6 -20
- package/dist/chris/navigation.js.map +1 -1
- package/dist/chris/pacsResources.d.ts +259 -0
- package/dist/chris/pacsResources.js +168 -0
- package/dist/chris/pacsResources.js.map +1 -0
- package/dist/core/commandDeclaration.d.ts +97 -7
- package/dist/core/commandDeclaration.js +21 -0
- package/dist/core/commandDeclaration.js.map +1 -1
- package/dist/core/commandParse.js +65 -17
- package/dist/core/commandParse.js.map +1 -1
- package/dist/core/commandRegistry.d.ts +4 -3
- package/dist/core/commandRegistry.js +36 -8
- package/dist/core/commandRegistry.js.map +1 -1
- package/dist/core/commandSchema.js +5 -2
- package/dist/core/commandSchema.js.map +1 -1
- package/dist/core/commandUsage.d.ts +15 -0
- package/dist/core/commandUsage.js +59 -7
- package/dist/core/commandUsage.js.map +1 -1
- package/dist/core/coreCommands.js +63 -212
- package/dist/core/coreCommands.js.map +1 -1
- package/dist/core/paths.d.ts +29 -1
- package/dist/core/paths.js +15 -2
- package/dist/core/paths.js.map +1 -1
- package/dist/core/preprocess.d.ts +3 -4
- package/dist/core/preprocess.js +4 -5
- package/dist/core/preprocess.js.map +1 -1
- package/dist/lib/completer/declared.js +7 -4
- package/dist/lib/completer/declared.js.map +1 -1
- package/dist/lib/completer/index.js +2 -7
- package/dist/lib/completer/index.js.map +1 -1
- package/dist/lib/parser.d.ts +0 -8
- package/dist/lib/parser.js +0 -11
- package/dist/lib/parser.js.map +1 -1
- package/dist/lib/vfs/vfs.d.ts +2 -1
- package/dist/lib/vfs/vfs.js +5 -4
- package/dist/lib/vfs/vfs.js.map +1 -1
- package/dist/notes.json +1 -1
- package/package.json +5 -5
|
@@ -1,15 +1,37 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @file
|
|
3
|
-
*
|
|
2
|
+
* @file `touch`: makes files in ChRIS's filesystem (CFS), empty or with text.
|
|
3
|
+
*
|
|
4
|
+
* Declared in one record (`touchCommand`): files, which glob, and the text
|
|
5
|
+
* to write, given inline (`--withContents`) or from a file on this machine
|
|
6
|
+
* (`--withContentsFromFile`). A path through a link is written where the
|
|
7
|
+
* link points.
|
|
8
|
+
*
|
|
9
|
+
* Key components:
|
|
10
|
+
* - touchCommand: the declaration.
|
|
11
|
+
* - builtin_touch: the declaration run over words already split.
|
|
12
|
+
* - touch_run: the typed core behind both, and the typed API.
|
|
13
|
+
*
|
|
14
|
+
* Typical usage:
|
|
15
|
+
* ```ts
|
|
16
|
+
* await builtin_touch(['--withContents', 'Hello!', 'greeting.txt']);
|
|
17
|
+
* await touch_run({ paths: ['greeting.txt'], contents: 'Hello!' });
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* Dependencies: the session's filesystem and listing cache, the store-path
|
|
21
|
+
* resolver, and this machine's disk (for `--withContentsFromFile`).
|
|
22
|
+
*
|
|
23
|
+
* @module
|
|
4
24
|
*/
|
|
5
25
|
import chalk from 'chalk';
|
|
6
26
|
import fs from 'fs';
|
|
7
27
|
import path from 'path';
|
|
8
|
-
import {
|
|
28
|
+
import { path_resolve, storePath_resolve } from '../utils.js';
|
|
9
29
|
import { listingCache_get, vfsDispatcher_get } from '../../core/filesystem.js';
|
|
10
30
|
import { pathEntry_find, entry_isFolder } from './entries.js';
|
|
11
31
|
import { errno_words, touch_render, vfs_fail } from '@fnndsc/fond';
|
|
12
32
|
import { envelope_ok, envelope_error } from '@fnndsc/menu';
|
|
33
|
+
import { command_declare } from '../../core/commandDeclaration.js';
|
|
34
|
+
import { declaredCommand_run } from '../../core/commandParse.js';
|
|
13
35
|
/**
|
|
14
36
|
* Reads the local file whose text a touch writes.
|
|
15
37
|
*
|
|
@@ -53,6 +75,64 @@ async function file_touch(dispatcher, targetPath, content) {
|
|
|
53
75
|
const written = await dispatcher.write(targetPath, content ?? '');
|
|
54
76
|
return written.ok || written.errno !== 'EISDIR' ? written : vfs_fail('EISDIR', `Is a directory: a folder already holds ${targetPath}`);
|
|
55
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* Forgets the listing of the folder that holds a touched file, by the
|
|
80
|
+
* session's path and by the store's.
|
|
81
|
+
*
|
|
82
|
+
* @param shown - The file as the session names it.
|
|
83
|
+
* @param targetPath - The file in the store.
|
|
84
|
+
*/
|
|
85
|
+
function parentListings_forget(shown, targetPath) {
|
|
86
|
+
for (const at of new Set([shown, targetPath]))
|
|
87
|
+
listingCache_get().cache_invalidate?.(path.posix.dirname(at));
|
|
88
|
+
}
|
|
89
|
+
/** What a `touch` line may hold. */
|
|
90
|
+
const TOUCH_GRAMMAR = {
|
|
91
|
+
operands: [
|
|
92
|
+
{ name: 'paths', kind: 'cfsPath', repeat: true, glob: true, summary: 'The files to make; with text, only the first takes it' },
|
|
93
|
+
],
|
|
94
|
+
options: {
|
|
95
|
+
withContents: { long: 'withContents', summary: 'Create the file with this text inline', value: { name: 'string', kind: 'word' } },
|
|
96
|
+
withContentsFromFile: { long: 'withContentsFromFile', summary: 'Create the file with the text of a file on this machine', value: { name: 'file', kind: 'hostPath' } },
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* `touch [--withContents <string>] [--withContentsFromFile <file>] <file…>`: the declaration.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```ts
|
|
104
|
+
* commands_register({ declarations: [touchCommand] });
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
export const touchCommand = command_declare({
|
|
108
|
+
name: 'touch',
|
|
109
|
+
grammar: TOUCH_GRAMMAR,
|
|
110
|
+
help: {
|
|
111
|
+
summary: 'Create empty files or files with content',
|
|
112
|
+
description: "Makes each file in ChRIS's filesystem: a file already there is left as it is, a missing one is made empty. With --withContents or --withContentsFromFile the first file is written whole with that text. A path through a link is written where the link points. touch makes no folders (mkdir -p does).",
|
|
113
|
+
category: 'Files',
|
|
114
|
+
posix: { group: 'Files', differs: 'makes a CFS file; --withContents writes text into it' },
|
|
115
|
+
examples: [
|
|
116
|
+
'touch file.txt # Create empty file',
|
|
117
|
+
'touch --withContents "Hello!" greeting.txt # Create file with string',
|
|
118
|
+
'touch --withContentsFromFile template.json config.json # Create from local file',
|
|
119
|
+
],
|
|
120
|
+
},
|
|
121
|
+
handler: async (args) => touch_run({
|
|
122
|
+
paths: args.operands.paths,
|
|
123
|
+
contents: args.options.withContents,
|
|
124
|
+
contentsFromFile: args.options.withContentsFromFile,
|
|
125
|
+
}),
|
|
126
|
+
});
|
|
127
|
+
/**
|
|
128
|
+
* `touch` over words already split: the declaration's parse and handler.
|
|
129
|
+
*
|
|
130
|
+
* @param args - The words after `touch`.
|
|
131
|
+
* @returns The envelope from {@link touch_run}, or the refusal of a bad line.
|
|
132
|
+
*/
|
|
133
|
+
export async function builtin_touch(args) {
|
|
134
|
+
return declaredCommand_run(touchCommand, args);
|
|
135
|
+
}
|
|
56
136
|
/**
|
|
57
137
|
* Creates empty files or updates timestamps: the shared typed core behind
|
|
58
138
|
* the parsed builtin and the typed API.
|
|
@@ -77,24 +157,25 @@ export async function touch_run(runOptions) {
|
|
|
77
157
|
}
|
|
78
158
|
const wrote = content !== undefined;
|
|
79
159
|
// Only the first path takes content.
|
|
80
|
-
const filesToTouch = wrote ?
|
|
160
|
+
const filesToTouch = wrote ? pathArgs.slice(0, 1) : pathArgs;
|
|
81
161
|
let rendered = '';
|
|
82
162
|
let renderedErr = '';
|
|
83
163
|
const outcomes = [];
|
|
84
164
|
const dispatcher = vfsDispatcher_get();
|
|
85
165
|
for (const pathArg of filesToTouch) {
|
|
86
166
|
try {
|
|
87
|
-
const
|
|
167
|
+
const shown = await path_resolve(pathArg);
|
|
168
|
+
const targetPath = await storePath_resolve(pathArg);
|
|
88
169
|
const done = await file_touch(dispatcher, targetPath, content);
|
|
89
170
|
if (done.ok) {
|
|
90
|
-
rendered += `${touch_render(
|
|
91
|
-
outcomes.push({ path:
|
|
92
|
-
|
|
171
|
+
rendered += `${touch_render(shown, true, wrote)}\n`;
|
|
172
|
+
outcomes.push({ path: shown, created: true });
|
|
173
|
+
parentListings_forget(shown, targetPath);
|
|
93
174
|
}
|
|
94
175
|
else {
|
|
95
|
-
renderedErr += `${chalk.red(`Failed to create file: ${
|
|
176
|
+
renderedErr += `${chalk.red(`Failed to create file: ${shown}`)}\n`;
|
|
96
177
|
renderedErr += `${chalk.gray(` ${done.reason ?? errno_words(done.errno)}`)}\n`;
|
|
97
|
-
outcomes.push({ path:
|
|
178
|
+
outcomes.push({ path: shown, created: false });
|
|
98
179
|
}
|
|
99
180
|
}
|
|
100
181
|
catch (e) {
|
|
@@ -112,21 +193,4 @@ export async function touch_run(runOptions) {
|
|
|
112
193
|
}
|
|
113
194
|
return envelope_ok(rendered, model);
|
|
114
195
|
}
|
|
115
|
-
/**
|
|
116
|
-
* Creates files from parsed command-line arguments.
|
|
117
|
-
*
|
|
118
|
-
* @param args - Command line arguments (paths and --withContents flags).
|
|
119
|
-
* @returns The envelope from {@link touch_run}.
|
|
120
|
-
*/
|
|
121
|
-
export async function builtin_touch(args) {
|
|
122
|
-
const parsed = commandArgs_process(args);
|
|
123
|
-
const refusal = optionsUnknown_refusal('touch', parsed, ['withContents', 'withContentsFromFile']);
|
|
124
|
-
if (refusal !== null)
|
|
125
|
-
return envelope_error('', undefined, `${chalk.red(refusal)}\n`);
|
|
126
|
-
return touch_run({
|
|
127
|
-
paths: parsed._,
|
|
128
|
-
contents: parsed['withContents'] !== undefined ? String(parsed['withContents']) : undefined,
|
|
129
|
-
contentsFromFile: parsed['withContentsFromFile'] !== undefined ? String(parsed['withContentsFromFile']) : undefined,
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
196
|
//# sourceMappingURL=touch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"touch.js","sourceRoot":"","sources":["../../../src/builtins/fs/touch.ts"],"names":[],"mappings":"AAAA
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C/F,MAAM,KAAK,GAA2C,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IAC3F,IAAI,SAAS,EAAE,CAAC;QACd,MAAM,QAAQ,GAAoB,cAAc,CAAC,QAAQ,EAAE,SAAS,EAAE,WAAW,IAAI,SAAS,CAAC,CAAC;QAChG,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;QACvB,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,OAAO,WAAW,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/** The session variable that says how many files move at once when a line does not. */
|
|
2
|
+
export declare const TRANSFER_JOBS_VARIABLE: string;
|
|
3
|
+
/**
|
|
4
|
+
* `-j N` / `--jobs N`: how many files move at once.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* const GRAMMAR = { options: { jobs: TRANSFER_JOBS_OPTION } } as const satisfies CommandGrammar;
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
export declare const TRANSFER_JOBS_OPTION: {
|
|
12
|
+
readonly short: "j";
|
|
13
|
+
readonly long: "jobs";
|
|
14
|
+
readonly summary: `Move N files at once, 1 to ${number} (1 is one at a time); without it $TRANSFER_JOBS, else ${number}`;
|
|
15
|
+
readonly value: {
|
|
16
|
+
readonly name: "N";
|
|
17
|
+
readonly kind: "int";
|
|
18
|
+
readonly min: 1;
|
|
19
|
+
readonly max: number;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* How many files a transfer moves at once, or why the session's variable
|
|
24
|
+
* cannot say.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const jobs: TransferJobs = { jobs: 8 };
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export type TransferJobs = {
|
|
32
|
+
readonly jobs: number;
|
|
33
|
+
} | {
|
|
34
|
+
readonly refused: string;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* The number of files a transfer moves at once: the line's `-j`, else the
|
|
38
|
+
* session's `TRANSFER_JOBS`, else the pool's default.
|
|
39
|
+
*
|
|
40
|
+
* @param given - The line's `-j`, already checked by the parser; undefined when the line gives none.
|
|
41
|
+
* @returns The number, or a plain line refusing the variable's value.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* transferJobs_resolve(4); // { jobs: 4 }
|
|
46
|
+
* transferJobs_resolve(undefined); // { jobs: 8 }, or $TRANSFER_JOBS
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export declare function transferJobs_resolve(given: number | undefined): TransferJobs;
|
|
50
|
+
/**
|
|
51
|
+
* The lines under a transfer's summary that name each file that failed
|
|
52
|
+
* after its retry, and say how many a cancel left.
|
|
53
|
+
*
|
|
54
|
+
* @param failedPaths - The files that failed, as the transfer names them.
|
|
55
|
+
* @param cancelledCount - How many files a cancel left unmoved.
|
|
56
|
+
* @param verb - What the transfer does to a file (`downloaded`, `uploaded`).
|
|
57
|
+
* @returns The lines, each ending in a newline; empty when nothing failed or was left.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* transferLeftovers_render(['/home/me/uploads/a.dcm'], 0, 'downloaded'); // ' failed: /home/me/uploads/a.dcm\n'
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export declare function transferLeftovers_render(failedPaths: readonly string[], cancelledCount: number, verb: string): string;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file How many files a transfer moves at once: the `-j N` / `--jobs N`
|
|
3
|
+
* option `download`, `upload` and `berth anchor` share, and the session
|
|
4
|
+
* variable `TRANSFER_JOBS` that stands in when a line gives none.
|
|
5
|
+
*
|
|
6
|
+
* The option's bounds are the transfer pool's (cumin's
|
|
7
|
+
* `TRANSFER_JOBS_MAX`), so the parser refuses `-j 40` before anything moves,
|
|
8
|
+
* and the variable is checked by the same `int` kind, so the two refuse in
|
|
9
|
+
* the same words.
|
|
10
|
+
*
|
|
11
|
+
* Key components:
|
|
12
|
+
* - TRANSFER_JOBS_OPTION: the option, for a command's grammar.
|
|
13
|
+
* - TRANSFER_JOBS_VARIABLE: the session variable's name.
|
|
14
|
+
* - transferJobs_resolve: the line's number, else the variable's, else the default.
|
|
15
|
+
* - transferLeftovers_render: the lines naming what failed and what a cancel left.
|
|
16
|
+
*
|
|
17
|
+
* Typical usage:
|
|
18
|
+
* ```ts
|
|
19
|
+
* const jobs: TransferJobs = transferJobs_resolve(args.options.jobs);
|
|
20
|
+
* if ('refused' in jobs) return refusal(jobs.refused);
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* Dependencies: cumin's transfer pool for the bounds; the session's variables.
|
|
24
|
+
*
|
|
25
|
+
* @module
|
|
26
|
+
*/
|
|
27
|
+
import chalk from 'chalk';
|
|
28
|
+
import { TRANSFER_JOBS_DEFAULT, TRANSFER_JOBS_MAX } from '@fnndsc/cumin/transfer-pool';
|
|
29
|
+
import { argumentWord_check } from '../../core/argumentKinds.js';
|
|
30
|
+
import { TEXT_KIND, variable_get } from '../../core/variables.js';
|
|
31
|
+
/** The session variable that says how many files move at once when a line does not. */
|
|
32
|
+
export const TRANSFER_JOBS_VARIABLE = 'TRANSFER_JOBS';
|
|
33
|
+
/**
|
|
34
|
+
* `-j N` / `--jobs N`: how many files move at once.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* const GRAMMAR = { options: { jobs: TRANSFER_JOBS_OPTION } } as const satisfies CommandGrammar;
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export const TRANSFER_JOBS_OPTION = {
|
|
42
|
+
short: 'j',
|
|
43
|
+
long: 'jobs',
|
|
44
|
+
summary: `Move N files at once, 1 to ${TRANSFER_JOBS_MAX} (1 is one at a time); without it $TRANSFER_JOBS, else ${TRANSFER_JOBS_DEFAULT}`,
|
|
45
|
+
value: { name: 'N', kind: 'int', min: 1, max: TRANSFER_JOBS_MAX },
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* The number of files a transfer moves at once: the line's `-j`, else the
|
|
49
|
+
* session's `TRANSFER_JOBS`, else the pool's default.
|
|
50
|
+
*
|
|
51
|
+
* @param given - The line's `-j`, already checked by the parser; undefined when the line gives none.
|
|
52
|
+
* @returns The number, or a plain line refusing the variable's value.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* transferJobs_resolve(4); // { jobs: 4 }
|
|
57
|
+
* transferJobs_resolve(undefined); // { jobs: 8 }, or $TRANSFER_JOBS
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export function transferJobs_resolve(given) {
|
|
61
|
+
if (given !== undefined)
|
|
62
|
+
return { jobs: given };
|
|
63
|
+
const variable = variable_get(TRANSFER_JOBS_VARIABLE);
|
|
64
|
+
if (variable === undefined)
|
|
65
|
+
return { jobs: TRANSFER_JOBS_DEFAULT };
|
|
66
|
+
const range = `it says how many files move at once, a whole number from 1 to ${TRANSFER_JOBS_MAX}`;
|
|
67
|
+
if (variable.answer.kind !== TEXT_KIND || typeof variable.answer.data !== 'string') {
|
|
68
|
+
return { refused: `${TRANSFER_JOBS_VARIABLE} holds a ${variable.answer.kind}; ${range}` };
|
|
69
|
+
}
|
|
70
|
+
const text = variable.answer.data.trim();
|
|
71
|
+
const checked = argumentWord_check(TRANSFER_JOBS_OPTION.value, text);
|
|
72
|
+
if (!checked.ok)
|
|
73
|
+
return { refused: `${TRANSFER_JOBS_VARIABLE} is ${text === '' ? "''" : text}; ${range}` };
|
|
74
|
+
return { jobs: checked.value };
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The lines under a transfer's summary that name each file that failed
|
|
78
|
+
* after its retry, and say how many a cancel left.
|
|
79
|
+
*
|
|
80
|
+
* @param failedPaths - The files that failed, as the transfer names them.
|
|
81
|
+
* @param cancelledCount - How many files a cancel left unmoved.
|
|
82
|
+
* @param verb - What the transfer does to a file (`downloaded`, `uploaded`).
|
|
83
|
+
* @returns The lines, each ending in a newline; empty when nothing failed or was left.
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```ts
|
|
87
|
+
* transferLeftovers_render(['/home/me/uploads/a.dcm'], 0, 'downloaded'); // ' failed: /home/me/uploads/a.dcm\n'
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
export function transferLeftovers_render(failedPaths, cancelledCount, verb) {
|
|
91
|
+
let rendered = '';
|
|
92
|
+
for (const failed of failedPaths)
|
|
93
|
+
rendered += `${chalk.red(` failed: ${failed}`)}\n`;
|
|
94
|
+
if (cancelledCount > 0)
|
|
95
|
+
rendered += `${chalk.yellow(` cancelled: ${cancelledCount} file(s) not ${verb}`)}\n`;
|
|
96
|
+
return rendered;
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=transferJobs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transferJobs.js","sourceRoot":"","sources":["../../../src/builtins/fs/transferJobs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEvF,OAAO,EAAE,kBAAkB,EAAsB,MAAM,6BAA6B,CAAC;AAErF,OAAO,EAAE,SAAS,EAAE,YAAY,EAAiB,MAAM,yBAAyB,CAAC;AAEjF,uFAAuF;AACvF,MAAM,CAAC,MAAM,sBAAsB,GAAW,eAAe,CAAC;AAE9D;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,KAAK,EAAE,GAAG;IACV,IAAI,EAAE,MAAM;IAC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M,UAAU,wBAAwB,CAAC,WAA8B,EAAE,cAAsB,EAAE,IAAY;IAC3G,IAAI,QAAQ,GAAW,EAAE,CAAC;IAC1B,KAAK,MAAM,MAAM,IAAI,WAAW;QAAE,QAAQ,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,aAAa,MAAM,EAAE,CAAC,IAAI,CAAC;IACtF,IAAI,cAAc,GAAG,CAAC;QAAE,QAAQ,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,gBAAgB,cAAc,gBAAgB,IAAI,EAAE,CAAC,IAAI,CAAC;IAC9G,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1,16 +1,43 @@
|
|
|
1
1
|
import { CommandEnvelope } from '@fnndsc/menu';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* Uses chili's scan_do machinery for recursive filesystem traversal.
|
|
5
|
-
*
|
|
6
|
-
* @param args - Command line arguments (optional path and flags).
|
|
7
|
-
* @returns A Promise that resolves when the tree is displayed.
|
|
3
|
+
* `tree [--follow] [--path] [--dirs] [--dirpath] [path]`: the declaration.
|
|
8
4
|
*
|
|
9
5
|
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* commands_register({ declarations: [treeCommand] }, 'backend');
|
|
10
8
|
* ```
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
*/
|
|
10
|
+
export declare const treeCommand: import("../../core/commandDeclaration.js").CommandDeclaration<{
|
|
11
|
+
readonly operands: readonly [{
|
|
12
|
+
readonly name: "path";
|
|
13
|
+
readonly kind: "cfsPath";
|
|
14
|
+
readonly optional: true;
|
|
15
|
+
readonly glob: true;
|
|
16
|
+
readonly summary: "The folder to draw; the working directory when none is given";
|
|
17
|
+
}];
|
|
18
|
+
readonly options: {
|
|
19
|
+
readonly follow: {
|
|
20
|
+
readonly long: "follow";
|
|
21
|
+
readonly summary: "Follow symbolic links when traversing";
|
|
22
|
+
};
|
|
23
|
+
readonly listPaths: {
|
|
24
|
+
readonly long: "path";
|
|
25
|
+
readonly summary: "Emit one full path per entry (grep-friendly, no tree art)";
|
|
26
|
+
};
|
|
27
|
+
readonly dirs: {
|
|
28
|
+
readonly long: "dirs";
|
|
29
|
+
readonly summary: "Show directories only";
|
|
30
|
+
};
|
|
31
|
+
readonly dirpath: {
|
|
32
|
+
readonly long: "dirpath";
|
|
33
|
+
readonly summary: "Emit one full directory path per line";
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
}>;
|
|
37
|
+
/**
|
|
38
|
+
* `tree` over words already split: the declaration's parse and handler.
|
|
39
|
+
*
|
|
40
|
+
* @param args - The words after `tree`.
|
|
41
|
+
* @returns The tree, or the refusal of a bad line.
|
|
15
42
|
*/
|
|
16
43
|
export declare function builtin_tree(args: string[]): Promise<CommandEnvelope>;
|
package/dist/builtins/fs/tree.js
CHANGED
|
@@ -1,9 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @file
|
|
3
|
-
*
|
|
2
|
+
* @file `tree`: a folder of ChRIS's filesystem (CFS) drawn as a tree, or
|
|
3
|
+
* listed one path per line.
|
|
4
|
+
*
|
|
5
|
+
* Declared in one record (`treeCommand`): one path, and its switches.
|
|
6
|
+
*
|
|
7
|
+
* Key components:
|
|
8
|
+
* - treeCommand: the declaration.
|
|
9
|
+
* - builtin_tree: the declaration run over words already split.
|
|
10
|
+
*
|
|
11
|
+
* Typical usage:
|
|
12
|
+
* ```ts
|
|
13
|
+
* await builtin_tree(['--dirs', '~/feeds']);
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* Dependencies: chili's scan for the walk; the listing for whether a path
|
|
17
|
+
* is there.
|
|
18
|
+
*
|
|
19
|
+
* @module
|
|
4
20
|
*/
|
|
5
21
|
import chalk from 'chalk';
|
|
6
|
-
import {
|
|
22
|
+
import { path_resolve, storePath_resolve, error_stripDebugPrefix } from '../utils.js';
|
|
23
|
+
import { command_declare } from '../../core/commandDeclaration.js';
|
|
24
|
+
import { declaredCommand_run } from '../../core/commandParse.js';
|
|
7
25
|
import { vfs } from '../../lib/vfs/vfs.js';
|
|
8
26
|
import { session } from '../../session/index.js';
|
|
9
27
|
import { spinner } from '../../lib/spinner.js';
|
|
@@ -12,55 +30,92 @@ import { bytes_format } from '@fnndsc/chili/commands/fs/upload.js';
|
|
|
12
30
|
import { errorStack } from '@fnndsc/fond';
|
|
13
31
|
import { envelope_ok, envelope_error } from '@fnndsc/menu';
|
|
14
32
|
import { exitCode_set } from '../../core/handlerRun.js';
|
|
15
|
-
/** The options tree reads; any other is refused by name. */
|
|
16
|
-
const TREE_OPTIONS = ['follow', 'path', 'dirs', 'dirpath'];
|
|
17
33
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
|
|
22
|
-
|
|
34
|
+
* What a `tree` line may hold. An option it does not have is refused, not
|
|
35
|
+
* skipped: `tree -L 1 x` once scanned a folder named `1`, and
|
|
36
|
+
* `tree --bogus x` the whole home.
|
|
37
|
+
*/
|
|
38
|
+
const TREE_GRAMMAR = {
|
|
39
|
+
operands: [
|
|
40
|
+
{ name: 'path', kind: 'cfsPath', optional: true, glob: true, summary: 'The folder to draw; the working directory when none is given' },
|
|
41
|
+
],
|
|
42
|
+
options: {
|
|
43
|
+
follow: { long: 'follow', summary: 'Follow symbolic links when traversing' },
|
|
44
|
+
listPaths: { long: 'path', summary: 'Emit one full path per entry (grep-friendly, no tree art)' },
|
|
45
|
+
dirs: { long: 'dirs', summary: 'Show directories only' },
|
|
46
|
+
dirpath: { long: 'dirpath', summary: 'Emit one full directory path per line' },
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* `tree [--follow] [--path] [--dirs] [--dirpath] [path]`: the declaration.
|
|
23
51
|
*
|
|
24
52
|
* @example
|
|
25
|
-
* ```
|
|
26
|
-
*
|
|
27
|
-
* tree /home/user/data # Tree of specific path
|
|
28
|
-
* tree --follow # Follow symbolic links
|
|
53
|
+
* ```ts
|
|
54
|
+
* commands_register({ declarations: [treeCommand] }, 'backend');
|
|
29
55
|
* ```
|
|
30
56
|
*/
|
|
57
|
+
export const treeCommand = command_declare({
|
|
58
|
+
name: 'tree',
|
|
59
|
+
grammar: TREE_GRAMMAR,
|
|
60
|
+
help: {
|
|
61
|
+
summary: 'Display directory tree structure',
|
|
62
|
+
description: "Draws a folder of ChRIS's filesystem and everything under it as a tree, with the total size and the number of items; or, with --path or --dirpath, lists one full path per line. The working directory when no path is given.",
|
|
63
|
+
category: 'Navigation',
|
|
64
|
+
posix: { group: 'Files', differs: 'a CFS tree' },
|
|
65
|
+
examples: [
|
|
66
|
+
'tree # Tree of current directory',
|
|
67
|
+
'tree /home/user/data # Tree of specific path',
|
|
68
|
+
'tree --follow # Follow symbolic links',
|
|
69
|
+
'tree --path # One path per line, no decoration',
|
|
70
|
+
'tree --dirs # Directory hierarchy only',
|
|
71
|
+
'tree --dirpath # One directory path per line',
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
holds: [],
|
|
75
|
+
handler: tree_run,
|
|
76
|
+
});
|
|
77
|
+
/**
|
|
78
|
+
* `tree` over words already split: the declaration's parse and handler.
|
|
79
|
+
*
|
|
80
|
+
* @param args - The words after `tree`.
|
|
81
|
+
* @returns The tree, or the refusal of a bad line.
|
|
82
|
+
*/
|
|
31
83
|
export async function builtin_tree(args) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
const dirpathMode =
|
|
44
|
-
const pathMode =
|
|
45
|
-
const dirsOnly =
|
|
46
|
-
//
|
|
84
|
+
return declaredCommand_run(treeCommand, args);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Displays a directory tree of the ChRIS filesystem.
|
|
88
|
+
* Uses chili's scan_do machinery for recursive filesystem traversal.
|
|
89
|
+
*
|
|
90
|
+
* @param args - The line, parsed.
|
|
91
|
+
* @returns The tree and its summary, or why it could not be drawn.
|
|
92
|
+
*/
|
|
93
|
+
async function tree_run(args) {
|
|
94
|
+
const pathArg = args.operands.path;
|
|
95
|
+
const dirpathMode = args.options.dirpath;
|
|
96
|
+
const pathMode = args.options.listPaths || dirpathMode;
|
|
97
|
+
const dirsOnly = args.options.dirs || dirpathMode;
|
|
98
|
+
// Read where the store keeps it (a run's data path, a link on the line),
|
|
99
|
+
// and shown as it was asked: the tree's root is the path as typed.
|
|
47
100
|
let targetPath;
|
|
48
|
-
|
|
49
|
-
|
|
101
|
+
let logicalRoot;
|
|
102
|
+
if (pathArg !== undefined) {
|
|
103
|
+
logicalRoot = await path_resolve(pathArg);
|
|
104
|
+
targetPath = await storePath_resolve(pathArg);
|
|
50
105
|
// A path that is not there is said to be not there, as tree says it,
|
|
51
106
|
// rather than scanned into an empty tree.
|
|
52
107
|
const entry = await vfs.data_get(targetPath, { directory: true });
|
|
53
108
|
if (!entry.ok) {
|
|
54
109
|
errorStack.stack_pop();
|
|
55
110
|
exitCode_set(1);
|
|
56
|
-
return envelope_error('', undefined, `${chalk.red(`tree: ${
|
|
111
|
+
return envelope_error('', undefined, `${chalk.red(`tree: ${pathArg}: No such file or directory`)}\n`);
|
|
57
112
|
}
|
|
58
113
|
}
|
|
59
114
|
// Build scan options
|
|
60
115
|
const scanOptions = {
|
|
61
116
|
silent: true,
|
|
62
117
|
tree: false, // We'll format it ourselves
|
|
63
|
-
follow:
|
|
118
|
+
follow: args.options.follow,
|
|
64
119
|
dirsOnly,
|
|
65
120
|
// A named folder is scanned where it stands: the shared directory stays put.
|
|
66
121
|
...(targetPath ? { folder: targetPath } : {}),
|
|
@@ -78,14 +133,18 @@ export async function builtin_tree(args) {
|
|
|
78
133
|
spinner.stop();
|
|
79
134
|
let rendered = '';
|
|
80
135
|
if (pathMode) {
|
|
81
|
-
// --path: emit one full
|
|
136
|
+
// --path: emit one full path per entry — grep-friendly, under the path asked
|
|
82
137
|
for (const item of scanResult.fileInfo) {
|
|
83
|
-
rendered += `${item.chrisPath}\n`;
|
|
138
|
+
rendered += `${shownPath_derive(item.chrisPath, targetPath, logicalRoot)}\n`;
|
|
84
139
|
}
|
|
85
140
|
}
|
|
86
141
|
else if (scanResult.fileInfo.length === 0) {
|
|
87
142
|
// An empty folder is its own tree: its name, and nothing under it.
|
|
88
|
-
rendered += `${
|
|
143
|
+
rendered += `${pathArg ?? originalFolder}\n`;
|
|
144
|
+
}
|
|
145
|
+
else if (targetPath !== undefined && pathArg !== undefined) {
|
|
146
|
+
// The tree hangs from the path as typed, its entries below it.
|
|
147
|
+
rendered += `${treeUnder_render(scanResult.fileInfo, targetPath, pathArg)}\n`;
|
|
89
148
|
}
|
|
90
149
|
else {
|
|
91
150
|
// Default: ASCII tree
|
|
@@ -96,4 +155,35 @@ export async function builtin_tree(args) {
|
|
|
96
155
|
rendered += `${chalk.gray(`${scanResult.fileInfo.length} items`)}\n`;
|
|
97
156
|
return envelope_ok(rendered);
|
|
98
157
|
}
|
|
158
|
+
/**
|
|
159
|
+
* A scanned path as the person asked for it: under the logical root in
|
|
160
|
+
* place of the store folder it was read from.
|
|
161
|
+
*
|
|
162
|
+
* @param chrisPath - The path the scan gave (a store path).
|
|
163
|
+
* @param storeRoot - The store folder scanned, when one was named.
|
|
164
|
+
* @param logicalRoot - The same folder as the session names it.
|
|
165
|
+
* @returns The path to show.
|
|
166
|
+
*/
|
|
167
|
+
function shownPath_derive(chrisPath, storeRoot, logicalRoot) {
|
|
168
|
+
if (storeRoot === undefined || logicalRoot === undefined)
|
|
169
|
+
return chrisPath;
|
|
170
|
+
if (chrisPath === storeRoot)
|
|
171
|
+
return logicalRoot;
|
|
172
|
+
return chrisPath.startsWith(`${storeRoot}/`) ? `${logicalRoot}${chrisPath.slice(storeRoot.length)}` : chrisPath;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Draws a scanned folder's tree hanging from the path as typed: its entries
|
|
176
|
+
* relative to the store folder they were read from.
|
|
177
|
+
*
|
|
178
|
+
* @param files - What the scan found.
|
|
179
|
+
* @param storeRoot - The store folder scanned.
|
|
180
|
+
* @param shown - The root's label: the path as typed.
|
|
181
|
+
* @returns The tree.
|
|
182
|
+
*/
|
|
183
|
+
function treeUnder_render(files, storeRoot, shown) {
|
|
184
|
+
const under = files.map((file) => (file.chrisPath.startsWith(`${storeRoot}/`) ? { ...file, chrisPath: file.chrisPath.slice(storeRoot.length + 1) } : file));
|
|
185
|
+
// archy draws the root's own label first: an empty line, which the path takes.
|
|
186
|
+
const lines = archyTree_create(under).split('\n');
|
|
187
|
+
return [shown, ...lines.slice(1)].join('\n').replace(/\n+$/, '');
|
|
188
|
+
}
|
|
99
189
|
//# sourceMappingURL=tree.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree.js","sourceRoot":"","sources":["../../../src/builtins/fs/tree.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"tree.js","sourceRoot":"","sources":["../../../src/builtins/fs/tree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACtF,OAAO,EAAE,eAAe,EAA8C,MAAM,kCAAkC,CAAC;AAC/G,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAiC,MAAM,mCAAmC,CAAC;AAI7G,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,UAA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