@dotpi/tools 2.11.3 → 2.11.5
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 +0 -1
- package/dotpi_root/bin/dotpi_prepare_sd_card +4 -4
- package/dotpi_root/dist/@dotpi/module/package.json +1 -1
- package/dotpi_root/dist/@dotpi/module/src/install.js +3 -2
- package/dotpi_root/dist/@dotpi/module/src/uninstall.js +5 -3
- package/dotpi_root/dist/@dotpi/module-module/package.json +2 -2
- package/dotpi_root/share/limits/zzz_dotpi_audio.conf +1 -1
- package/package.json +3 -3
- package/src/constants.js +1 -0
- package/src/create-project.js +5 -0
- package/src/templates/package.json +5 -0
package/README.md
CHANGED
|
@@ -308,8 +308,7 @@ if [ -d "$source_path" ] && [ -r "$source_path" ] ; then
|
|
|
308
308
|
(set -o pipefail ; \
|
|
309
309
|
cd -- "$source_path" && tar c "${tar_options[@]}" -- *.nmconnection* \
|
|
310
310
|
| tar x -C "$destination_path") || {
|
|
311
|
-
|
|
312
|
-
exit 1
|
|
311
|
+
dotpi_echo_warning "No network connection found in ${source_path}"
|
|
313
312
|
}
|
|
314
313
|
fi
|
|
315
314
|
|
|
@@ -319,7 +318,7 @@ if ! $(wpa_passphrase test 12345678 > /dev/null 2>&1) ; then
|
|
|
319
318
|
dotpi_echo_warning "Network password won't be salted, 'wpa_passphrase' is needed to salt passwords."
|
|
320
319
|
else
|
|
321
320
|
|
|
322
|
-
|
|
321
|
+
while IFS= read -r -d '' file ; do
|
|
323
322
|
key='wifi-security.psk'
|
|
324
323
|
psk="$(dotpi_connection_read --file "$file" --key "$key")"
|
|
325
324
|
|
|
@@ -332,7 +331,8 @@ else
|
|
|
332
331
|
dotpi_connection_write --file "$file" --key "$key" --value "$passphrase"
|
|
333
332
|
fi
|
|
334
333
|
|
|
335
|
-
|
|
334
|
+
# do not salt templates, as ssid and psk may depend on variables
|
|
335
|
+
done < <(find "${destination_path}" -name '*.nmconnection' -print0)
|
|
336
336
|
fi
|
|
337
337
|
|
|
338
338
|
|
|
@@ -80,8 +80,8 @@ export async function install(modules = [], {
|
|
|
80
80
|
let output;
|
|
81
81
|
let cwd;
|
|
82
82
|
|
|
83
|
-
if(verbose
|
|
84
|
-
|
|
83
|
+
if(verbose !== 'none') {
|
|
84
|
+
echo.info(`Installing module '${moduleToInstall}' in '${dotpiModulesDestination}'`);
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
// create link first, it may be used in postinstall scripts
|
|
@@ -101,6 +101,7 @@ export async function install(modules = [], {
|
|
|
101
101
|
// full install with postinstall scripts for each request
|
|
102
102
|
})`
|
|
103
103
|
npx pnpm install
|
|
104
|
+
--prod
|
|
104
105
|
--dangerously-allow-all-builds
|
|
105
106
|
--
|
|
106
107
|
${moduleToInstall}
|
|
@@ -69,17 +69,20 @@ export async function uninstall(modules = [], {
|
|
|
69
69
|
switch (verbose) {
|
|
70
70
|
case '0':
|
|
71
71
|
case 'false':
|
|
72
|
+
case 'none':
|
|
72
73
|
case false:
|
|
73
74
|
verbose = 'none';
|
|
74
75
|
break;
|
|
75
76
|
|
|
76
77
|
case '1':
|
|
77
78
|
case 'true':
|
|
79
|
+
case 'sort':
|
|
78
80
|
case true:
|
|
79
81
|
verbose = 'short';
|
|
80
82
|
break;
|
|
81
83
|
|
|
82
84
|
case '2':
|
|
85
|
+
case 'full':
|
|
83
86
|
verbose = 'full';
|
|
84
87
|
break;
|
|
85
88
|
}
|
|
@@ -158,9 +161,8 @@ export async function uninstall(modules = [], {
|
|
|
158
161
|
env: { FORCE_COLOR: 'true' }, // do not remove colors
|
|
159
162
|
verbose: (verbose === 'full' ? 'full' : 'none'),
|
|
160
163
|
})`
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
--save
|
|
164
|
+
npx pnpm
|
|
165
|
+
remove
|
|
164
166
|
--
|
|
165
167
|
${moduleName}
|
|
166
168
|
`;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotpi/module-module",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.1",
|
|
4
4
|
"description": "dotpi module management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": "./bin/dotpi_module",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"license": "BSD-3-clause",
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@dotpi/javascript": "^1.6.3",
|
|
14
|
-
"@dotpi/module": "^1.10.
|
|
14
|
+
"@dotpi/module": "^1.10.1",
|
|
15
15
|
"commander": "^12.1.0"
|
|
16
16
|
}
|
|
17
17
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotpi/tools",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.5",
|
|
4
4
|
"description": "Set of scripts for managing dotpi fleets of Raspberry Pi",
|
|
5
5
|
"author": "Jean-Philippe Lambert",
|
|
6
6
|
"contributors": [
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"license": "BSD-3-Clause",
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@dotpi/javascript": "^1.6.3",
|
|
40
|
-
"@dotpi/module": "^1.10.
|
|
40
|
+
"@dotpi/module": "^1.10.1",
|
|
41
41
|
"chalk": "^5.3.0",
|
|
42
42
|
"commander": "^12.1.0",
|
|
43
43
|
"prompts": "^2.4.2",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"lerna": "^8.2.4"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "6861c092464092495b95248b677943961eec5ebc"
|
|
50
50
|
}
|
package/src/constants.js
CHANGED
|
@@ -21,6 +21,7 @@ export const PATH_NETWORK_DIRECTORY = 'network';
|
|
|
21
21
|
export const PATH_GITIGNORE = '.gitignore';
|
|
22
22
|
export const PATH_README = 'README.md';
|
|
23
23
|
export const PATH_DOTPI_FILE = '.dotpi';
|
|
24
|
+
export const PATH_PACKAGE_JSON = 'package.json';
|
|
24
25
|
// these ones are within a project, e.g. where the next instance number is stored
|
|
25
26
|
export const PATH_DOTPI_TMP_DIRECTORY = 'tmp';
|
|
26
27
|
export const PATH_DOTPI_TMP_BASH = path.join(PATH_DOTPI_TMP_DIRECTORY, 'dotpi_tmp.bash');
|
package/src/create-project.js
CHANGED
|
@@ -34,6 +34,7 @@ import {
|
|
|
34
34
|
PATH_GITIGNORE,
|
|
35
35
|
PATH_README,
|
|
36
36
|
PATH_DOTPI_FILE,
|
|
37
|
+
PATH_PACKAGE_JSON,
|
|
37
38
|
// utilities
|
|
38
39
|
DOTPI_SSH_KEYS_PREFIX,
|
|
39
40
|
PROJECT_NAME_REGEXP,
|
|
@@ -435,6 +436,10 @@ export async function injectUtilityFiles(data) {
|
|
|
435
436
|
PATH_SSH_DIRECTORY,
|
|
436
437
|
PATH_NETWORK_DIRECTORY,
|
|
437
438
|
});
|
|
439
|
+
|
|
440
|
+
data.files[PATH_PACKAGE_JSON] = renderTemplate('package.json', {
|
|
441
|
+
projectName,
|
|
442
|
+
});
|
|
438
443
|
}
|
|
439
444
|
|
|
440
445
|
export async function persistProject(data, mocks = null) {
|