@dotpi/tools 2.12.3 → 2.13.0
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/dotpi-tools.js +12 -3
- package/dotpi_root/bin/dotpi_prepare_system +35 -16
- package/dotpi_root/dist/@dotpi/javascript/LICENSE +28 -0
- package/dotpi_root/dist/@dotpi/javascript/node_modules/execa/lib/arguments/shell.js +11 -0
- package/dotpi_root/dist/@dotpi/javascript/node_modules/execa/lib/methods/main-async.js +2 -1
- package/dotpi_root/dist/@dotpi/javascript/node_modules/execa/lib/methods/main-sync.js +2 -1
- package/dotpi_root/dist/@dotpi/javascript/node_modules/execa/package.json +13 -12
- package/dotpi_root/dist/@dotpi/javascript/node_modules/execa/readme.md +22 -12
- package/dotpi_root/dist/@dotpi/javascript/node_modules/execa/types/verbose.d.ts +1 -1
- package/dotpi_root/dist/@dotpi/javascript/package.json +4 -3
- package/dotpi_root/dist/@dotpi/module/node_modules/execa/lib/arguments/shell.js +11 -0
- package/dotpi_root/dist/@dotpi/module/node_modules/execa/lib/methods/main-async.js +2 -1
- package/dotpi_root/dist/@dotpi/module/node_modules/execa/lib/methods/main-sync.js +2 -1
- package/dotpi_root/dist/@dotpi/module/node_modules/execa/package.json +13 -12
- package/dotpi_root/dist/@dotpi/module/node_modules/execa/readme.md +22 -12
- package/dotpi_root/dist/@dotpi/module/node_modules/execa/types/verbose.d.ts +1 -1
- package/dotpi_root/dist/@dotpi/module/package.json +5 -6
- package/dotpi_root/dist/@dotpi/module/src/install.js +6 -1
- package/dotpi_root/dist/@dotpi/module/src/pnpm.js +18 -14
- package/dotpi_root/dist/@dotpi/module/src/uninstall.js +7 -3
- package/dotpi_root/dist/@dotpi/module-module/bin/dotpi_module +10 -1
- package/dotpi_root/dist/@dotpi/module-module/package.json +4 -4
- package/dotpi_root/etc/dotpi_environment_default.bash +1 -4
- package/dotpi_root/share/dotpi_functions/dotpi_functions_audio_device.bash +37 -3
- package/package.json +8 -5
- package/dotpi_root/dist/@dotpi/avahi-monitor-module/node_modules/.package-lock.json +0 -7
- package/dotpi_root/dist/@dotpi/javascript/node_modules/.package-lock.json +0 -308
- package/dotpi_root/dist/@dotpi/javascript/node_modules/get-stream/license +0 -9
- package/dotpi_root/dist/@dotpi/javascript/node_modules/get-stream/package.json +0 -60
- package/dotpi_root/dist/@dotpi/javascript/node_modules/get-stream/readme.md +0 -303
- package/dotpi_root/dist/@dotpi/javascript/node_modules/get-stream/source/array-buffer.js +0 -84
- package/dotpi_root/dist/@dotpi/javascript/node_modules/get-stream/source/array.js +0 -32
- package/dotpi_root/dist/@dotpi/javascript/node_modules/get-stream/source/buffer.js +0 -19
- package/dotpi_root/dist/@dotpi/javascript/node_modules/get-stream/source/contents.js +0 -121
- package/dotpi_root/dist/@dotpi/javascript/node_modules/get-stream/source/exports.js +0 -5
- package/dotpi_root/dist/@dotpi/javascript/node_modules/get-stream/source/index.d.ts +0 -121
- package/dotpi_root/dist/@dotpi/javascript/node_modules/get-stream/source/index.js +0 -13
- package/dotpi_root/dist/@dotpi/javascript/node_modules/get-stream/source/stream.js +0 -65
- package/dotpi_root/dist/@dotpi/javascript/node_modules/get-stream/source/string.js +0 -41
- package/dotpi_root/dist/@dotpi/javascript/node_modules/get-stream/source/utils.js +0 -11
- package/dotpi_root/dist/@dotpi/javascript/node_modules/is-stream/index.d.ts +0 -90
- package/dotpi_root/dist/@dotpi/javascript/node_modules/is-stream/index.js +0 -37
- package/dotpi_root/dist/@dotpi/javascript/node_modules/is-stream/license +0 -9
- package/dotpi_root/dist/@dotpi/javascript/node_modules/is-stream/package.json +0 -48
- package/dotpi_root/dist/@dotpi/javascript/node_modules/is-stream/readme.md +0 -57
- package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/LICENSE.txt +0 -16
- package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/README.md +0 -74
- package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/cjs/browser.d.ts +0 -12
- package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/cjs/browser.d.ts.map +0 -1
- package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/cjs/browser.js +0 -10
- package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/cjs/browser.js.map +0 -1
- package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/cjs/index.d.ts +0 -48
- package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/cjs/index.d.ts.map +0 -1
- package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/cjs/index.js +0 -279
- package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/cjs/index.js.map +0 -1
- package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/cjs/package.json +0 -3
- package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/cjs/signals.d.ts +0 -29
- package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/cjs/signals.d.ts.map +0 -1
- package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/cjs/signals.js +0 -42
- package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/cjs/signals.js.map +0 -1
- package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/mjs/browser.d.ts +0 -12
- package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/mjs/browser.d.ts.map +0 -1
- package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/mjs/browser.js +0 -4
- package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/mjs/browser.js.map +0 -1
- package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/mjs/index.d.ts +0 -48
- package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/mjs/index.d.ts.map +0 -1
- package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/mjs/index.js +0 -275
- package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/mjs/index.js.map +0 -1
- package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/mjs/package.json +0 -3
- package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/mjs/signals.d.ts +0 -29
- package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/mjs/signals.d.ts.map +0 -1
- package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/mjs/signals.js +0 -39
- package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/mjs/signals.js.map +0 -1
- package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/package.json +0 -106
- package/dotpi_root/dist/@dotpi/module/node_modules/get-stream/license +0 -9
- package/dotpi_root/dist/@dotpi/module/node_modules/get-stream/package.json +0 -60
- package/dotpi_root/dist/@dotpi/module/node_modules/get-stream/readme.md +0 -303
- package/dotpi_root/dist/@dotpi/module/node_modules/get-stream/source/array-buffer.js +0 -84
- package/dotpi_root/dist/@dotpi/module/node_modules/get-stream/source/array.js +0 -32
- package/dotpi_root/dist/@dotpi/module/node_modules/get-stream/source/buffer.js +0 -19
- package/dotpi_root/dist/@dotpi/module/node_modules/get-stream/source/contents.js +0 -121
- package/dotpi_root/dist/@dotpi/module/node_modules/get-stream/source/exports.js +0 -5
- package/dotpi_root/dist/@dotpi/module/node_modules/get-stream/source/index.d.ts +0 -121
- package/dotpi_root/dist/@dotpi/module/node_modules/get-stream/source/index.js +0 -13
- package/dotpi_root/dist/@dotpi/module/node_modules/get-stream/source/stream.js +0 -65
- package/dotpi_root/dist/@dotpi/module/node_modules/get-stream/source/string.js +0 -41
- package/dotpi_root/dist/@dotpi/module/node_modules/get-stream/source/utils.js +0 -11
- package/dotpi_root/dist/@dotpi/module/node_modules/is-stream/index.d.ts +0 -90
- package/dotpi_root/dist/@dotpi/module/node_modules/is-stream/index.js +0 -37
- package/dotpi_root/dist/@dotpi/module/node_modules/is-stream/license +0 -9
- package/dotpi_root/dist/@dotpi/module/node_modules/is-stream/package.json +0 -48
- package/dotpi_root/dist/@dotpi/module/node_modules/is-stream/readme.md +0 -57
- package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/LICENSE.txt +0 -16
- package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/README.md +0 -74
- package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/cjs/browser.d.ts +0 -12
- package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/cjs/browser.d.ts.map +0 -1
- package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/cjs/browser.js +0 -10
- package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/cjs/browser.js.map +0 -1
- package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/cjs/index.d.ts +0 -48
- package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/cjs/index.d.ts.map +0 -1
- package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/cjs/index.js +0 -279
- package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/cjs/index.js.map +0 -1
- package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/cjs/package.json +0 -3
- package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/cjs/signals.d.ts +0 -29
- package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/cjs/signals.d.ts.map +0 -1
- package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/cjs/signals.js +0 -42
- package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/cjs/signals.js.map +0 -1
- package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/mjs/browser.d.ts +0 -12
- package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/mjs/browser.d.ts.map +0 -1
- package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/mjs/browser.js +0 -4
- package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/mjs/browser.js.map +0 -1
- package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/mjs/index.d.ts +0 -48
- package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/mjs/index.d.ts.map +0 -1
- package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/mjs/index.js +0 -275
- package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/mjs/index.js.map +0 -1
- package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/mjs/package.json +0 -3
- package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/mjs/signals.d.ts +0 -29
- package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/mjs/signals.d.ts.map +0 -1
- package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/mjs/signals.js +0 -39
- package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/mjs/signals.js.map +0 -1
- package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/package.json +0 -106
package/dotpi-tools.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { program } from 'commander';
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
import { pnpmResolveInPath } from '@dotpi/module/pnpm.js';
|
|
5
|
+
import * as echo from '@dotpi/javascript/echo.js';
|
|
4
6
|
|
|
5
7
|
import { greetings } from './src/utils.js';
|
|
6
8
|
import createProject from './src/create-project.js';
|
|
@@ -8,6 +10,11 @@ import installRpi from './src/install-rpi.js';
|
|
|
8
10
|
import configureHost from './src/configure-host.js';
|
|
9
11
|
import { packageVersion } from './src/utils.js';
|
|
10
12
|
|
|
13
|
+
if(!await pnpmResolveInPath()) {
|
|
14
|
+
echo.error('> pnpm is not in path: please install pnpm before.');
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
17
|
+
|
|
11
18
|
program
|
|
12
19
|
.option('--create-project', 'create a new dotpi project')
|
|
13
20
|
.option('--install-rpi', 'install a dotpi project on a Raspberry Pi SD card')
|
|
@@ -37,11 +44,13 @@ if (options.createProject) {
|
|
|
37
44
|
displayGreetings = false;
|
|
38
45
|
console.log(packageVersion());
|
|
39
46
|
} else if (options.launchManager) {
|
|
40
|
-
|
|
47
|
+
echo.error('> launchManager is not implemented yet');
|
|
48
|
+
exit(2);
|
|
41
49
|
} else {
|
|
42
50
|
// @todo prompt
|
|
43
|
-
|
|
51
|
+
echo.error('> Invalid option:');
|
|
44
52
|
console.log(options);
|
|
53
|
+
exit(3);
|
|
45
54
|
}
|
|
46
55
|
|
|
47
56
|
|
|
@@ -211,14 +211,29 @@ n_path_to_symlinks() (
|
|
|
211
211
|
# bootstrap: node, npm
|
|
212
212
|
n_path_to_symlinks
|
|
213
213
|
|
|
214
|
-
# pnpm is
|
|
215
|
-
|
|
214
|
+
# pnpm is required globally for @dotpi/module-module
|
|
215
|
+
# it could not be installed locally as it may upgrade, while upgrade produces an error for 32 bit systems
|
|
216
|
+
for package in \
|
|
217
|
+
"${dotpi_node_install_default[@]}" \
|
|
218
|
+
"${dotpi_node_install[@]}" \
|
|
219
|
+
"pnpm" \
|
|
220
|
+
; do
|
|
221
|
+
|
|
222
|
+
if [[ "$package" == "pnpm" ]] ; then
|
|
223
|
+
|
|
224
|
+
if [[ $word_size == "32" ]] ; then
|
|
225
|
+
# pnpm@11 is last version that supports 32 bit systems
|
|
226
|
+
package="pnpm@11"
|
|
227
|
+
fi
|
|
228
|
+
|
|
229
|
+
fi
|
|
230
|
+
|
|
216
231
|
npm -g install "$package" || {
|
|
217
232
|
error_exit $? "npm install ${package}" $error_exit_code_node
|
|
218
233
|
}
|
|
219
234
|
done
|
|
220
235
|
|
|
221
|
-
# update
|
|
236
|
+
# update with installed node packages
|
|
222
237
|
n_path_to_symlinks
|
|
223
238
|
|
|
224
239
|
############## services and modules
|
|
@@ -229,25 +244,29 @@ dotpi echo_info "Enable linger to run user services without login"
|
|
|
229
244
|
sudo loginctl enable-linger "$FIRSTUSER" || {
|
|
230
245
|
error_exit $? "loginctl enable-linger" $error_exit_code_services
|
|
231
246
|
}
|
|
232
|
-
|
|
233
247
|
############# dotpi module manager
|
|
234
248
|
|
|
235
249
|
# # bootstrap-install
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
destination_prefix="${DOTPI_ROOT}/lib"
|
|
239
|
-
destination_path="${destination_prefix}/node_modules/${module_name}"
|
|
250
|
+
dist_path="${DOTPI_ROOT}/dist"
|
|
251
|
+
lib_path="${DOTPI_ROOT}/lib"
|
|
240
252
|
|
|
241
|
-
{
|
|
242
|
-
cd
|
|
243
|
-
|
|
244
|
-
|
|
253
|
+
cd "${dist_path}/@dotpi/module" || {
|
|
254
|
+
error_exit $? "cd ${dist_path}/@dotpi/module" $error_exit_code_services
|
|
255
|
+
}
|
|
256
|
+
sudo pnpm install --prod --dangerously-allow-all-builds || {
|
|
257
|
+
error_exit $? "pnpm install @dotpi/module" $error_exit_code_services
|
|
258
|
+
}
|
|
245
259
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
260
|
+
cd "${dist_path}/@dotpi/module-module" || {
|
|
261
|
+
error_exit $? "cd ${dist_path}/@dotpi/module-module" $error_exit_code_services
|
|
262
|
+
}
|
|
263
|
+
sudo pnpm link -- ../module
|
|
264
|
+
sudo pnpm install --prod --dangerously-allow-all-builds
|
|
265
|
+
|
|
266
|
+
cd "${lib_path}" || {
|
|
267
|
+
error_exit $? "cd ${lib_path}" $error_exit_code_services
|
|
250
268
|
}
|
|
269
|
+
sudo pnpm add --prod --dangerously-allow-all-builds -- "${dist_path}/@dotpi/module-module"
|
|
251
270
|
|
|
252
271
|
############## audio
|
|
253
272
|
error_exit_code_audio=6
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Copyright (c) 2023-present IRCAM – Centre Pompidou (France, Paris)
|
|
2
|
+
|
|
3
|
+
All rights reserved.
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without modification,
|
|
6
|
+
are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
* Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
* Redistributions in binary form must reproduce the above copyright notice, this
|
|
12
|
+
list of conditions and the following disclaimer in the documentation and/or
|
|
13
|
+
other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
* Neither the name of the IRCAM nor the names of its
|
|
16
|
+
contributors may be used to endorse or promote products derived from
|
|
17
|
+
this software without specific prior written permission.
|
|
18
|
+
|
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
20
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
21
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
|
23
|
+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
24
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
25
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
26
|
+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
27
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
28
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// When the `shell` option is set, any command argument is concatenated as a single string by Node.js:
|
|
2
|
+
// https://github.com/nodejs/node/blob/e38ce27f3ca0a65f68a31cedd984cddb927d4002/lib/child_process.js#L614-L624
|
|
3
|
+
// However, since Node 24, it also prints a deprecation warning.
|
|
4
|
+
// To avoid this warning, we perform that same operation before calling `node:child_process`.
|
|
5
|
+
// Shells only understand strings, which is why Node.js performs that concatenation.
|
|
6
|
+
// However, we rely on users splitting command arguments as an array.
|
|
7
|
+
// For example, this allows us to easily detect which arguments are passed.
|
|
8
|
+
// So we do want users to pass array of arguments even with `shell: true`, but we also want to avoid any warning.
|
|
9
|
+
export const concatenateShell = (file, commandArguments, options) => options.shell && commandArguments.length > 0
|
|
10
|
+
? [[file, ...commandArguments].join(' '), [], options]
|
|
11
|
+
: [file, commandArguments, options];
|
|
@@ -4,6 +4,7 @@ import {MaxBufferError} from 'get-stream';
|
|
|
4
4
|
import {handleCommand} from '../arguments/command.js';
|
|
5
5
|
import {normalizeOptions} from '../arguments/options.js';
|
|
6
6
|
import {SUBPROCESS_OPTIONS} from '../arguments/fd-options.js';
|
|
7
|
+
import {concatenateShell} from '../arguments/shell.js';
|
|
7
8
|
import {addIpcMethods} from '../ipc/methods.js';
|
|
8
9
|
import {makeError, makeSuccessResult} from '../return/result.js';
|
|
9
10
|
import {handleResult} from '../return/reject.js';
|
|
@@ -75,7 +76,7 @@ const handleAsyncOptions = ({timeout, signal, ...options}) => {
|
|
|
75
76
|
const spawnSubprocessAsync = ({file, commandArguments, options, startTime, verboseInfo, command, escapedCommand, fileDescriptors}) => {
|
|
76
77
|
let subprocess;
|
|
77
78
|
try {
|
|
78
|
-
subprocess = spawn(file, commandArguments, options);
|
|
79
|
+
subprocess = spawn(...concatenateShell(file, commandArguments, options));
|
|
79
80
|
} catch (error) {
|
|
80
81
|
return handleEarlyError({
|
|
81
82
|
error,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {spawnSync} from 'node:child_process';
|
|
2
2
|
import {handleCommand} from '../arguments/command.js';
|
|
3
3
|
import {normalizeOptions} from '../arguments/options.js';
|
|
4
|
+
import {concatenateShell} from '../arguments/shell.js';
|
|
4
5
|
import {makeError, makeEarlyError, makeSuccessResult} from '../return/result.js';
|
|
5
6
|
import {handleResult} from '../return/reject.js';
|
|
6
7
|
import {handleStdioSync} from '../stdio/handle-sync.js';
|
|
@@ -115,7 +116,7 @@ const runSubprocessSync = ({file, commandArguments, options, command, escapedCom
|
|
|
115
116
|
try {
|
|
116
117
|
addInputOptionsSync(fileDescriptors, options);
|
|
117
118
|
const normalizedOptions = normalizeSpawnSyncOptions(options);
|
|
118
|
-
return spawnSync(file, commandArguments, normalizedOptions);
|
|
119
|
+
return spawnSync(...concatenateShell(file, commandArguments, normalizedOptions));
|
|
119
120
|
} catch (error) {
|
|
120
121
|
return makeEarlyError({
|
|
121
122
|
error,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "execa",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.6.1",
|
|
4
4
|
"description": "Process execution for humans",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "sindresorhus/execa",
|
|
@@ -52,32 +52,33 @@
|
|
|
52
52
|
],
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@sindresorhus/merge-streams": "^4.0.0",
|
|
55
|
-
"cross-spawn": "^7.0.
|
|
55
|
+
"cross-spawn": "^7.0.6",
|
|
56
56
|
"figures": "^6.1.0",
|
|
57
57
|
"get-stream": "^9.0.0",
|
|
58
|
-
"human-signals": "^8.0.
|
|
58
|
+
"human-signals": "^8.0.1",
|
|
59
59
|
"is-plain-obj": "^4.1.0",
|
|
60
60
|
"is-stream": "^4.0.1",
|
|
61
61
|
"npm-run-path": "^6.0.0",
|
|
62
|
-
"pretty-ms": "^9.
|
|
62
|
+
"pretty-ms": "^9.2.0",
|
|
63
63
|
"signal-exit": "^4.1.0",
|
|
64
64
|
"strip-final-newline": "^4.0.0",
|
|
65
|
-
"yoctocolors": "^2.
|
|
65
|
+
"yoctocolors": "^2.1.1"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@types/node": "^22.
|
|
69
|
-
"ava": "^6.0
|
|
70
|
-
"c8": "^10.1.
|
|
71
|
-
"get-node": "^15.0.
|
|
68
|
+
"@types/node": "^22.15.21",
|
|
69
|
+
"ava": "^6.3.0",
|
|
70
|
+
"c8": "^10.1.3",
|
|
71
|
+
"get-node": "^15.0.3",
|
|
72
72
|
"is-in-ci": "^1.0.0",
|
|
73
73
|
"is-running": "^2.1.0",
|
|
74
|
+
"log-process-errors": "^12.0.1",
|
|
74
75
|
"path-exists": "^5.0.0",
|
|
75
76
|
"path-key": "^4.0.0",
|
|
76
77
|
"tempfile": "^5.0.0",
|
|
77
|
-
"tsd": "^0.
|
|
78
|
-
"typescript": "^5.
|
|
78
|
+
"tsd": "^0.32.0",
|
|
79
|
+
"typescript": "^5.8.3",
|
|
79
80
|
"which": "^5.0.0",
|
|
80
|
-
"xo": "^0.
|
|
81
|
+
"xo": "^0.60.0"
|
|
81
82
|
},
|
|
82
83
|
"c8": {
|
|
83
84
|
"reporter": [
|
|
@@ -22,20 +22,36 @@
|
|
|
22
22
|
<sup>Special thanks to:</sup>
|
|
23
23
|
<br>
|
|
24
24
|
<br>
|
|
25
|
-
<
|
|
25
|
+
<br>
|
|
26
|
+
<a href="https://coderabbit.ai?utm_source=sindre&utm_medium=execa">
|
|
27
|
+
<img width="300" src="https://sindresorhus.com/assets/thanks/coderabbit-logo.png" alt="CodeRabbit logo">
|
|
28
|
+
</a>
|
|
29
|
+
<br>
|
|
30
|
+
<br>
|
|
31
|
+
<br>
|
|
32
|
+
<a href="https://kruu.com">
|
|
26
33
|
<picture>
|
|
27
|
-
<source
|
|
28
|
-
<source
|
|
29
|
-
<img
|
|
34
|
+
<source srcset="https://sindresorhus.com/assets/thanks/kruu-logo-dark.svg?y" media="(prefers-color-scheme: dark)" width="260">
|
|
35
|
+
<source srcset="https://sindresorhus.com/assets/thanks/kruu-logo-light.svg?y" media="(prefers-color-scheme: light)" width="260">
|
|
36
|
+
<img src="https://sindresorhus.com/assets/thanks/kruu-logo-light.svg?y" width="260"alt="KRUU logo">
|
|
30
37
|
</picture>
|
|
31
38
|
</a>
|
|
32
39
|
<br>
|
|
33
40
|
<br>
|
|
34
|
-
<
|
|
35
|
-
|
|
41
|
+
<br>
|
|
42
|
+
<a href="https://depot.dev?utm_source=github&utm_medium=sindresorhus">
|
|
43
|
+
<div>
|
|
44
|
+
<picture>
|
|
45
|
+
<source width="180" media="(prefers-color-scheme: dark)" srcset="https://sindresorhus.com/assets/thanks/depot-logo-dark.svg">
|
|
46
|
+
<source width="180" media="(prefers-color-scheme: light)" srcset="https://sindresorhus.com/assets/thanks/depot-logo-light.svg">
|
|
47
|
+
<img width="180" src="https://sindresorhus.com/assets/thanks/depot-logo-light.svg" alt="Depot logo">
|
|
48
|
+
</picture>
|
|
49
|
+
</div>
|
|
50
|
+
<b>Fast remote container builds and GitHub Actions runners.</b>
|
|
36
51
|
</a>
|
|
37
52
|
<br>
|
|
38
53
|
<br>
|
|
54
|
+
<br>
|
|
39
55
|
</p>
|
|
40
56
|
</div>
|
|
41
57
|
|
|
@@ -45,12 +61,6 @@
|
|
|
45
61
|
|
|
46
62
|
Execa runs commands in your script, application or library. Unlike shells, it is [optimized](docs/bash.md) for programmatic usage. Built on top of the [`child_process`](https://nodejs.org/api/child_process.html) core module.
|
|
47
63
|
|
|
48
|
-
---
|
|
49
|
-
|
|
50
|
-
One of the maintainers [@ehmicky](https://github.com/ehmicky) is looking for a remote full-time position. Specialized in Node.js back-ends and CLIs, he led Netlify [Build](https://www.netlify.com/platform/core/build/), [Plugins](https://www.netlify.com/integrations/) and Configuration for 2.5 years. Feel free to contact him on [his website](https://www.mickael-hebert.com) or on [LinkedIn](https://www.linkedin.com/in/mickaelhebert/)!
|
|
51
|
-
|
|
52
|
-
---
|
|
53
|
-
|
|
54
64
|
## Features
|
|
55
65
|
|
|
56
66
|
- [Simple syntax](#simple-syntax): promises and [template strings](docs/execution.md#template-string-syntax), like [`zx`](docs/bash.md).
|
|
@@ -2,7 +2,7 @@ import type {FdGenericOption} from './arguments/specific.js';
|
|
|
2
2
|
import type {Options, SyncOptions} from './arguments/options.js';
|
|
3
3
|
import type {Result, SyncResult} from './return/result.js';
|
|
4
4
|
|
|
5
|
-
type VerboseOption = FdGenericOption<
|
|
5
|
+
export type VerboseOption = FdGenericOption<
|
|
6
6
|
| 'none'
|
|
7
7
|
| 'short'
|
|
8
8
|
| 'full'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotpi/javascript",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "dotpi javascript utilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "^5.4.0",
|
|
13
|
-
"execa": "^9.
|
|
13
|
+
"execa": "^9.6.1",
|
|
14
14
|
"template-literal": "^1.0.4"
|
|
15
|
-
}
|
|
15
|
+
},
|
|
16
|
+
"gitHead": "a2a5dfe6969c72dbf0e79466b969e0cfa9cb453f"
|
|
16
17
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// When the `shell` option is set, any command argument is concatenated as a single string by Node.js:
|
|
2
|
+
// https://github.com/nodejs/node/blob/e38ce27f3ca0a65f68a31cedd984cddb927d4002/lib/child_process.js#L614-L624
|
|
3
|
+
// However, since Node 24, it also prints a deprecation warning.
|
|
4
|
+
// To avoid this warning, we perform that same operation before calling `node:child_process`.
|
|
5
|
+
// Shells only understand strings, which is why Node.js performs that concatenation.
|
|
6
|
+
// However, we rely on users splitting command arguments as an array.
|
|
7
|
+
// For example, this allows us to easily detect which arguments are passed.
|
|
8
|
+
// So we do want users to pass array of arguments even with `shell: true`, but we also want to avoid any warning.
|
|
9
|
+
export const concatenateShell = (file, commandArguments, options) => options.shell && commandArguments.length > 0
|
|
10
|
+
? [[file, ...commandArguments].join(' '), [], options]
|
|
11
|
+
: [file, commandArguments, options];
|
|
@@ -4,6 +4,7 @@ import {MaxBufferError} from 'get-stream';
|
|
|
4
4
|
import {handleCommand} from '../arguments/command.js';
|
|
5
5
|
import {normalizeOptions} from '../arguments/options.js';
|
|
6
6
|
import {SUBPROCESS_OPTIONS} from '../arguments/fd-options.js';
|
|
7
|
+
import {concatenateShell} from '../arguments/shell.js';
|
|
7
8
|
import {addIpcMethods} from '../ipc/methods.js';
|
|
8
9
|
import {makeError, makeSuccessResult} from '../return/result.js';
|
|
9
10
|
import {handleResult} from '../return/reject.js';
|
|
@@ -75,7 +76,7 @@ const handleAsyncOptions = ({timeout, signal, ...options}) => {
|
|
|
75
76
|
const spawnSubprocessAsync = ({file, commandArguments, options, startTime, verboseInfo, command, escapedCommand, fileDescriptors}) => {
|
|
76
77
|
let subprocess;
|
|
77
78
|
try {
|
|
78
|
-
subprocess = spawn(file, commandArguments, options);
|
|
79
|
+
subprocess = spawn(...concatenateShell(file, commandArguments, options));
|
|
79
80
|
} catch (error) {
|
|
80
81
|
return handleEarlyError({
|
|
81
82
|
error,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {spawnSync} from 'node:child_process';
|
|
2
2
|
import {handleCommand} from '../arguments/command.js';
|
|
3
3
|
import {normalizeOptions} from '../arguments/options.js';
|
|
4
|
+
import {concatenateShell} from '../arguments/shell.js';
|
|
4
5
|
import {makeError, makeEarlyError, makeSuccessResult} from '../return/result.js';
|
|
5
6
|
import {handleResult} from '../return/reject.js';
|
|
6
7
|
import {handleStdioSync} from '../stdio/handle-sync.js';
|
|
@@ -115,7 +116,7 @@ const runSubprocessSync = ({file, commandArguments, options, command, escapedCom
|
|
|
115
116
|
try {
|
|
116
117
|
addInputOptionsSync(fileDescriptors, options);
|
|
117
118
|
const normalizedOptions = normalizeSpawnSyncOptions(options);
|
|
118
|
-
return spawnSync(file, commandArguments, normalizedOptions);
|
|
119
|
+
return spawnSync(...concatenateShell(file, commandArguments, normalizedOptions));
|
|
119
120
|
} catch (error) {
|
|
120
121
|
return makeEarlyError({
|
|
121
122
|
error,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "execa",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.6.1",
|
|
4
4
|
"description": "Process execution for humans",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "sindresorhus/execa",
|
|
@@ -52,32 +52,33 @@
|
|
|
52
52
|
],
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@sindresorhus/merge-streams": "^4.0.0",
|
|
55
|
-
"cross-spawn": "^7.0.
|
|
55
|
+
"cross-spawn": "^7.0.6",
|
|
56
56
|
"figures": "^6.1.0",
|
|
57
57
|
"get-stream": "^9.0.0",
|
|
58
|
-
"human-signals": "^8.0.
|
|
58
|
+
"human-signals": "^8.0.1",
|
|
59
59
|
"is-plain-obj": "^4.1.0",
|
|
60
60
|
"is-stream": "^4.0.1",
|
|
61
61
|
"npm-run-path": "^6.0.0",
|
|
62
|
-
"pretty-ms": "^9.
|
|
62
|
+
"pretty-ms": "^9.2.0",
|
|
63
63
|
"signal-exit": "^4.1.0",
|
|
64
64
|
"strip-final-newline": "^4.0.0",
|
|
65
|
-
"yoctocolors": "^2.
|
|
65
|
+
"yoctocolors": "^2.1.1"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@types/node": "^22.
|
|
69
|
-
"ava": "^6.0
|
|
70
|
-
"c8": "^10.1.
|
|
71
|
-
"get-node": "^15.0.
|
|
68
|
+
"@types/node": "^22.15.21",
|
|
69
|
+
"ava": "^6.3.0",
|
|
70
|
+
"c8": "^10.1.3",
|
|
71
|
+
"get-node": "^15.0.3",
|
|
72
72
|
"is-in-ci": "^1.0.0",
|
|
73
73
|
"is-running": "^2.1.0",
|
|
74
|
+
"log-process-errors": "^12.0.1",
|
|
74
75
|
"path-exists": "^5.0.0",
|
|
75
76
|
"path-key": "^4.0.0",
|
|
76
77
|
"tempfile": "^5.0.0",
|
|
77
|
-
"tsd": "^0.
|
|
78
|
-
"typescript": "^5.
|
|
78
|
+
"tsd": "^0.32.0",
|
|
79
|
+
"typescript": "^5.8.3",
|
|
79
80
|
"which": "^5.0.0",
|
|
80
|
-
"xo": "^0.
|
|
81
|
+
"xo": "^0.60.0"
|
|
81
82
|
},
|
|
82
83
|
"c8": {
|
|
83
84
|
"reporter": [
|
|
@@ -22,20 +22,36 @@
|
|
|
22
22
|
<sup>Special thanks to:</sup>
|
|
23
23
|
<br>
|
|
24
24
|
<br>
|
|
25
|
-
<
|
|
25
|
+
<br>
|
|
26
|
+
<a href="https://coderabbit.ai?utm_source=sindre&utm_medium=execa">
|
|
27
|
+
<img width="300" src="https://sindresorhus.com/assets/thanks/coderabbit-logo.png" alt="CodeRabbit logo">
|
|
28
|
+
</a>
|
|
29
|
+
<br>
|
|
30
|
+
<br>
|
|
31
|
+
<br>
|
|
32
|
+
<a href="https://kruu.com">
|
|
26
33
|
<picture>
|
|
27
|
-
<source
|
|
28
|
-
<source
|
|
29
|
-
<img
|
|
34
|
+
<source srcset="https://sindresorhus.com/assets/thanks/kruu-logo-dark.svg?y" media="(prefers-color-scheme: dark)" width="260">
|
|
35
|
+
<source srcset="https://sindresorhus.com/assets/thanks/kruu-logo-light.svg?y" media="(prefers-color-scheme: light)" width="260">
|
|
36
|
+
<img src="https://sindresorhus.com/assets/thanks/kruu-logo-light.svg?y" width="260"alt="KRUU logo">
|
|
30
37
|
</picture>
|
|
31
38
|
</a>
|
|
32
39
|
<br>
|
|
33
40
|
<br>
|
|
34
|
-
<
|
|
35
|
-
|
|
41
|
+
<br>
|
|
42
|
+
<a href="https://depot.dev?utm_source=github&utm_medium=sindresorhus">
|
|
43
|
+
<div>
|
|
44
|
+
<picture>
|
|
45
|
+
<source width="180" media="(prefers-color-scheme: dark)" srcset="https://sindresorhus.com/assets/thanks/depot-logo-dark.svg">
|
|
46
|
+
<source width="180" media="(prefers-color-scheme: light)" srcset="https://sindresorhus.com/assets/thanks/depot-logo-light.svg">
|
|
47
|
+
<img width="180" src="https://sindresorhus.com/assets/thanks/depot-logo-light.svg" alt="Depot logo">
|
|
48
|
+
</picture>
|
|
49
|
+
</div>
|
|
50
|
+
<b>Fast remote container builds and GitHub Actions runners.</b>
|
|
36
51
|
</a>
|
|
37
52
|
<br>
|
|
38
53
|
<br>
|
|
54
|
+
<br>
|
|
39
55
|
</p>
|
|
40
56
|
</div>
|
|
41
57
|
|
|
@@ -45,12 +61,6 @@
|
|
|
45
61
|
|
|
46
62
|
Execa runs commands in your script, application or library. Unlike shells, it is [optimized](docs/bash.md) for programmatic usage. Built on top of the [`child_process`](https://nodejs.org/api/child_process.html) core module.
|
|
47
63
|
|
|
48
|
-
---
|
|
49
|
-
|
|
50
|
-
One of the maintainers [@ehmicky](https://github.com/ehmicky) is looking for a remote full-time position. Specialized in Node.js back-ends and CLIs, he led Netlify [Build](https://www.netlify.com/platform/core/build/), [Plugins](https://www.netlify.com/integrations/) and Configuration for 2.5 years. Feel free to contact him on [his website](https://www.mickael-hebert.com) or on [LinkedIn](https://www.linkedin.com/in/mickaelhebert/)!
|
|
51
|
-
|
|
52
|
-
---
|
|
53
|
-
|
|
54
64
|
## Features
|
|
55
65
|
|
|
56
66
|
- [Simple syntax](#simple-syntax): promises and [template strings](docs/execution.md#template-string-syntax), like [`zx`](docs/bash.md).
|
|
@@ -2,7 +2,7 @@ import type {FdGenericOption} from './arguments/specific.js';
|
|
|
2
2
|
import type {Options, SyncOptions} from './arguments/options.js';
|
|
3
3
|
import type {Result, SyncResult} from './return/result.js';
|
|
4
4
|
|
|
5
|
-
type VerboseOption = FdGenericOption<
|
|
5
|
+
export type VerboseOption = FdGenericOption<
|
|
6
6
|
| 'none'
|
|
7
7
|
| 'short'
|
|
8
8
|
| 'full'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotpi/module",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.0",
|
|
4
4
|
"description": "dotpi module management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -8,10 +8,9 @@
|
|
|
8
8
|
},
|
|
9
9
|
"license": "BSD-3-clause",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@dotpi/javascript": "^1.
|
|
12
|
-
"execa": "^9.
|
|
13
|
-
"globby": "^14.0.2"
|
|
14
|
-
"pnpm": "^11.28.11"
|
|
11
|
+
"@dotpi/javascript": "^1.7.0",
|
|
12
|
+
"execa": "^9.6.1",
|
|
13
|
+
"globby": "^14.0.2"
|
|
15
14
|
},
|
|
16
|
-
"gitHead": "
|
|
15
|
+
"gitHead": "a2a5dfe6969c72dbf0e79466b969e0cfa9cb453f"
|
|
17
16
|
}
|
|
@@ -7,7 +7,7 @@ import * as echo from '@dotpi/javascript/echo.js';
|
|
|
7
7
|
|
|
8
8
|
import { dotpiConfigurationGet } from './configuration.js';
|
|
9
9
|
|
|
10
|
-
import { pnpmExecutable } from './pnpm.js';
|
|
10
|
+
import { pnpmResolveInPath, pnpmExecutable } from './pnpm.js';
|
|
11
11
|
|
|
12
12
|
export function installCommandDefine({program}) {
|
|
13
13
|
program
|
|
@@ -32,6 +32,11 @@ export async function install(modules = [], {
|
|
|
32
32
|
modules = [modules];
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
if(!await pnpmResolveInPath()) {
|
|
36
|
+
echo.error('pnpm is not in path: please install pnpm');
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
|
|
35
40
|
switch (verbose) {
|
|
36
41
|
case '0':
|
|
37
42
|
case 'false':
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import path from 'node:path';
|
|
1
|
+
import { $ } from 'execa';
|
|
3
2
|
|
|
4
|
-
//
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const pnpmExecutableRelativePath = (typeof pnpmPackage.bin === 'string'
|
|
9
|
-
? pnpmPackage.bin
|
|
10
|
-
: pnpmPackage.bin.pnpm
|
|
11
|
-
);
|
|
3
|
+
// pnpm is required for @dotpi/module-module
|
|
4
|
+
// It can not installed locally with npm.
|
|
5
|
+
// Version 11, needed for 32 bit systems may not respect versions from package.json, and try to upgrade.
|
|
6
|
+
// Version 12 breaks on 32 bit systems.
|
|
12
7
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
)
|
|
8
|
+
// do not run locally or via npx
|
|
9
|
+
export const pnpmExecutable = 'pnpm';
|
|
10
|
+
|
|
11
|
+
export async function pnpmResolveInPath() {
|
|
12
|
+
|
|
13
|
+
try {
|
|
14
|
+
const output = await $`which ${pnpmExecutable}`;
|
|
15
|
+
return output.exitCode === 0;
|
|
16
|
+
} catch (error) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
}
|
|
@@ -9,7 +9,7 @@ import * as echo from '@dotpi/javascript/echo.js';
|
|
|
9
9
|
import { dotpiConfigurationGet } from './configuration.js';
|
|
10
10
|
import { definitionGet } from './definition.js';
|
|
11
11
|
|
|
12
|
-
import { pnpmExecutable } from './pnpm.js';
|
|
12
|
+
import { pnpmResolveInPath, pnpmExecutable } from './pnpm.js';
|
|
13
13
|
|
|
14
14
|
export async function uninstallCommandDefine({program}) {
|
|
15
15
|
program
|
|
@@ -29,6 +29,11 @@ async function uninstallScriptRun(module, {
|
|
|
29
29
|
} = {}) {
|
|
30
30
|
try {
|
|
31
31
|
|
|
32
|
+
if (!await pnpmResolveInPath()) {
|
|
33
|
+
echo.error('pnpm is not in path: please install pnpm');
|
|
34
|
+
process.exit(1);
|
|
35
|
+
}
|
|
36
|
+
|
|
32
37
|
const cwd = module;
|
|
33
38
|
const output = await $({
|
|
34
39
|
cwd,
|
|
@@ -163,8 +168,7 @@ export async function uninstall(modules = [], {
|
|
|
163
168
|
env: { FORCE_COLOR: 'true' }, // do not remove colors
|
|
164
169
|
verbose: (verbose === 'full' ? 'full' : 'none'),
|
|
165
170
|
})`
|
|
166
|
-
${pnpmExecutable}
|
|
167
|
-
remove
|
|
171
|
+
${pnpmExecutable} remove
|
|
168
172
|
--
|
|
169
173
|
${moduleName}
|
|
170
174
|
`;
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { pnpmResolveInPath } from '@dotpi/module/pnpm.js';
|
|
4
|
+
|
|
5
|
+
import * as echo from '@dotpi/javascript/echo.js';
|
|
4
6
|
|
|
5
7
|
import { installCommandDefine } from '@dotpi/module/install.js';
|
|
6
8
|
import { uninstallCommandDefine } from '@dotpi/module/uninstall.js';
|
|
7
9
|
import { createConfigCommandDefine } from '@dotpi/module/createConfig.js';
|
|
8
10
|
|
|
11
|
+
import { program } from 'commander';
|
|
12
|
+
|
|
13
|
+
if(!await pnpmResolveInPath()) {
|
|
14
|
+
echo.error('pnpm is not in path: please install pnpm');
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
17
|
+
|
|
9
18
|
installCommandDefine({ program });
|
|
10
19
|
uninstallCommandDefine({ program });
|
|
11
20
|
createConfigCommandDefine({ program });
|