@dotpi/tools 2.10.2 → 2.11.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/dotpi_root/bin/dotpi_prepare_system +33 -55
- package/dotpi_root/dist/@dotpi/module/package.json +1 -1
- package/dotpi_root/dist/@dotpi/module/src/install.js +13 -43
- package/dotpi_root/dist/@dotpi/module-module/package.json +2 -2
- package/dotpi_root/etc/dotpi_environment_default.bash +5 -0
- package/package.json +3 -3
|
@@ -190,35 +190,37 @@ while ! N_PREFIX="$N_PREFIX" bash /tmp/n-install -y -a "$node_arch" "$dotpi_node
|
|
|
190
190
|
sudo mkdir -p -- "$N_PREFIX"
|
|
191
191
|
done
|
|
192
192
|
|
|
193
|
-
|
|
194
193
|
rm -f /tmp/n-install
|
|
195
194
|
|
|
196
195
|
|
|
197
|
-
|
|
198
|
-
# echo "
|
|
199
|
-
# # dotpi: force the usage of -a for correct architecture
|
|
200
|
-
# # (n relies on uname, which tells about the kernel, not the executables)
|
|
201
|
-
|
|
202
|
-
# alias n='${environment_variables[*]} n -a ${node_arch}'
|
|
203
|
-
# " >> "${HOME}/.bashrc" || {
|
|
204
|
-
# error_exit $? "n alias in /root/.bashrc" $error_exit_code_node
|
|
205
|
-
# }
|
|
206
|
-
|
|
207
196
|
source_path="${N_PREFIX}/bin"
|
|
208
197
|
destination_path="/usr/bin"
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
198
|
+
|
|
199
|
+
n_path_to_symlinks() (
|
|
200
|
+
cd "${N_PREFIX}/bin" || {
|
|
201
|
+
error_exit $? "cd ${N_PREFIX}/bin" $error_exit_code_node
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
for executable in * ; do
|
|
205
|
+
sudo ln -s -f "${source_path}/${executable}" "${destination_path}/${executable}" || {
|
|
206
|
+
error_exit $? "symlink to ${destination_path}/${executable}" $error_exit_code_node
|
|
207
|
+
}
|
|
208
|
+
done
|
|
215
209
|
)
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
210
|
+
|
|
211
|
+
# bootstrap: node, npm
|
|
212
|
+
n_path_to_symlinks
|
|
213
|
+
|
|
214
|
+
# pnpm is mandatory for node modules
|
|
215
|
+
for package in "${dotpi_node_install_default[@]}" "${dotpi_node_install[@]}" ; do
|
|
216
|
+
npm -g install "$package" || {
|
|
217
|
+
error_exit $? "npm install ${package}" $error_exit_code_node
|
|
218
|
+
}
|
|
220
219
|
done
|
|
221
220
|
|
|
221
|
+
# update: pnpm
|
|
222
|
+
n_path_to_symlinks
|
|
223
|
+
|
|
222
224
|
############## services and modules
|
|
223
225
|
error_exit_code_services=4
|
|
224
226
|
|
|
@@ -230,46 +232,22 @@ sudo loginctl enable-linger "$FIRSTUSER" || {
|
|
|
230
232
|
|
|
231
233
|
############# dotpi module manager
|
|
232
234
|
|
|
233
|
-
# bootstrap-install
|
|
235
|
+
# # bootstrap-install
|
|
234
236
|
module_name="@dotpi/module-module"
|
|
235
237
|
source_path="${DOTPI_ROOT}/dist/${module_name}"
|
|
236
238
|
destination_prefix="${DOTPI_ROOT}/lib"
|
|
237
239
|
destination_path="${destination_prefix}/node_modules/${module_name}"
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
--prefix "$destination_prefix" \
|
|
243
|
-
--install-strategy nested \
|
|
244
|
-
--omit dev \
|
|
245
|
-
--save \
|
|
246
|
-
--ignore-scripts \
|
|
247
|
-
-- \
|
|
248
|
-
"$source_path" || {
|
|
249
|
-
error_exit $? "dotpi_module: error when installing '${module_name}'" $error_exit_code_services
|
|
240
|
+
|
|
241
|
+
(
|
|
242
|
+
cd "$destination_prefix" || {
|
|
243
|
+
error_exit $? "cd ${destination_prefix}" $error_exit_code_services
|
|
250
244
|
}
|
|
251
245
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
sudo rm -rf "${destination_path}/node_modules" || {
|
|
259
|
-
error_exit $? "rm ${destination_path}/node_modules" $error_exit_code_services
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
sudo npm install --no-fund \
|
|
263
|
-
--prefix "$destination_path" \
|
|
264
|
-
--omit dev \
|
|
265
|
-
--install-links \
|
|
266
|
-
|| {
|
|
267
|
-
error_exit $? "dotpi_module: error when installing '${module_name}' dependencies'" $error_exit_code_services
|
|
268
|
-
}
|
|
269
|
-
)
|
|
270
|
-
} || {
|
|
271
|
-
error_exit $? "${module_name}" $error_exit_code_services
|
|
272
|
-
}
|
|
246
|
+
sudo npx pnpm install --dangerously-allow-all-builds -- \
|
|
247
|
+
"$$module_name" || {
|
|
248
|
+
error_exit $? "dotpi_module: error when installing '${module_name}'" $error_exit_code_services
|
|
249
|
+
}
|
|
250
|
+
)
|
|
273
251
|
|
|
274
252
|
############## audio
|
|
275
253
|
error_exit_code_audio=6
|
|
@@ -35,17 +35,20 @@ export async function install(modules = [], {
|
|
|
35
35
|
switch (verbose) {
|
|
36
36
|
case '0':
|
|
37
37
|
case 'false':
|
|
38
|
+
case 'none':
|
|
38
39
|
case false:
|
|
39
40
|
verbose = 'none';
|
|
40
41
|
break;
|
|
41
42
|
|
|
42
43
|
case '1':
|
|
43
44
|
case 'true':
|
|
45
|
+
case 'short':
|
|
44
46
|
case true:
|
|
45
47
|
verbose = 'short';
|
|
46
48
|
break;
|
|
47
49
|
|
|
48
50
|
case '2':
|
|
51
|
+
case 'full':
|
|
49
52
|
verbose = 'full';
|
|
50
53
|
break;
|
|
51
54
|
}
|
|
@@ -78,62 +81,29 @@ export async function install(modules = [], {
|
|
|
78
81
|
let cwd;
|
|
79
82
|
|
|
80
83
|
if(verbose === 'full') {
|
|
81
|
-
console.log(`
|
|
84
|
+
console.log(`Installing '${moduleToInstall}'`);
|
|
82
85
|
}
|
|
83
|
-
const moduleDefinition = await definitionGet(moduleToInstall);
|
|
84
|
-
const { name: moduleName } = moduleDefinition;
|
|
85
|
-
|
|
86
|
-
// 2-steps install as npm errors when installing from git
|
|
87
|
-
// npm error git dep preparation failed
|
|
88
|
-
|
|
89
|
-
if(verbose !== 'none') {
|
|
90
|
-
echo.info(`Installing module '${moduleToInstall}' in '${dotpiModulesDestination}'`);
|
|
91
|
-
}
|
|
92
|
-
cwd = dotpiModulesDestination;
|
|
93
|
-
output = await $({
|
|
94
|
-
cwd,
|
|
95
|
-
env: { FORCE_COLOR: 'true' }, // do not remove colors
|
|
96
|
-
verbose: (verbose === 'full' ? 'full' : 'none'),
|
|
97
|
-
// minimal install in the modules directory
|
|
98
|
-
})`
|
|
99
|
-
npm --prefix ${cwd}
|
|
100
|
-
install --no-fund
|
|
101
|
-
--install-strategy nested
|
|
102
|
-
--omit dev
|
|
103
|
-
--save
|
|
104
|
-
--ignore-scripts
|
|
105
|
-
--
|
|
106
|
-
${moduleToInstall}
|
|
107
|
-
`;
|
|
108
86
|
|
|
87
|
+
// create link first, it may be used in postinstall scripts
|
|
109
88
|
await symlink(
|
|
110
89
|
path.join('.', 'node_modules'),
|
|
111
90
|
path.join(dotpiModulesDestination, 'dotpi_modules')
|
|
112
91
|
);
|
|
113
92
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
cwd = path.resolve(dotpiModulesDestination, 'node_modules', moduleName);
|
|
118
|
-
|
|
119
|
-
// perform a clean install
|
|
120
|
-
await fs.rm(path.resolve(cwd, 'node_modules'), {
|
|
121
|
-
recursive: true,
|
|
122
|
-
force: true,
|
|
123
|
-
});
|
|
93
|
+
const moduleDefinition = await definitionGet(moduleToInstall);
|
|
94
|
+
const { name: moduleName } = moduleDefinition;
|
|
124
95
|
|
|
96
|
+
cwd = dotpiModulesDestination;
|
|
125
97
|
output = await $({
|
|
126
98
|
cwd,
|
|
127
99
|
env: { FORCE_COLOR: 'true' }, // do not remove colors
|
|
128
100
|
verbose: (verbose === 'full' ? 'full' : 'none'),
|
|
129
|
-
//
|
|
130
|
-
// be sure to install links for relative dependencies also
|
|
131
|
-
// run postinstall script
|
|
101
|
+
// full install with postinstall scripts for each request
|
|
132
102
|
})`
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
--
|
|
136
|
-
|
|
103
|
+
npx pnpm install
|
|
104
|
+
--dangerously-allow-all-builds
|
|
105
|
+
--
|
|
106
|
+
${moduleToInstall}
|
|
137
107
|
`;
|
|
138
108
|
|
|
139
109
|
} catch (error) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotpi/module-module",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
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.
|
|
14
|
+
"@dotpi/module": "^1.10.0",
|
|
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.
|
|
3
|
+
"version": "2.11.1",
|
|
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.
|
|
40
|
+
"@dotpi/module": "^1.10.0",
|
|
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": "512a97fa2b2c25e01ed981c76cf3c78cf5613af5"
|
|
50
50
|
}
|