@dotpi/tools 2.11.6 → 2.12.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.
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "dotpi_avahi_monitor",
3
+ "version": "1.0.0",
4
+ "lockfileVersion": 3,
5
+ "requires": true,
6
+ "packages": {}
7
+ }
@@ -0,0 +1,308 @@
1
+ {
2
+ "name": "@dotpi/js-tools",
3
+ "version": "1.0.0",
4
+ "lockfileVersion": 3,
5
+ "requires": true,
6
+ "packages": {
7
+ "node_modules/@sec-ant/readable-stream": {
8
+ "version": "0.4.1",
9
+ "resolved": "https://registry.npmjs.org/@sec-ant/readable-stream/-/readable-stream-0.4.1.tgz",
10
+ "integrity": "sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==",
11
+ "license": "MIT"
12
+ },
13
+ "node_modules/@sindresorhus/merge-streams": {
14
+ "version": "4.0.0",
15
+ "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-4.0.0.tgz",
16
+ "integrity": "sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==",
17
+ "license": "MIT",
18
+ "engines": {
19
+ "node": ">=18"
20
+ },
21
+ "funding": {
22
+ "url": "https://github.com/sponsors/sindresorhus"
23
+ }
24
+ },
25
+ "node_modules/chalk": {
26
+ "version": "5.4.0",
27
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.4.0.tgz",
28
+ "integrity": "sha512-ZkD35Mx92acjB2yNJgziGqT9oKHEOxjTBTDRpOsRWtdecL/0jM3z5kM/CTzHWvHIen1GvkM85p6TuFfDGfc8/Q==",
29
+ "license": "MIT",
30
+ "engines": {
31
+ "node": "^12.17.0 || ^14.13 || >=16.0.0"
32
+ },
33
+ "funding": {
34
+ "url": "https://github.com/chalk/chalk?sponsor=1"
35
+ }
36
+ },
37
+ "node_modules/cross-spawn": {
38
+ "version": "7.0.6",
39
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
40
+ "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
41
+ "license": "MIT",
42
+ "dependencies": {
43
+ "path-key": "^3.1.0",
44
+ "shebang-command": "^2.0.0",
45
+ "which": "^2.0.1"
46
+ },
47
+ "engines": {
48
+ "node": ">= 8"
49
+ }
50
+ },
51
+ "node_modules/execa": {
52
+ "version": "9.5.2",
53
+ "resolved": "https://registry.npmjs.org/execa/-/execa-9.5.2.tgz",
54
+ "integrity": "sha512-EHlpxMCpHWSAh1dgS6bVeoLAXGnJNdR93aabr4QCGbzOM73o5XmRfM/e5FUqsw3aagP8S8XEWUWFAxnRBnAF0Q==",
55
+ "license": "MIT",
56
+ "dependencies": {
57
+ "@sindresorhus/merge-streams": "^4.0.0",
58
+ "cross-spawn": "^7.0.3",
59
+ "figures": "^6.1.0",
60
+ "get-stream": "^9.0.0",
61
+ "human-signals": "^8.0.0",
62
+ "is-plain-obj": "^4.1.0",
63
+ "is-stream": "^4.0.1",
64
+ "npm-run-path": "^6.0.0",
65
+ "pretty-ms": "^9.0.0",
66
+ "signal-exit": "^4.1.0",
67
+ "strip-final-newline": "^4.0.0",
68
+ "yoctocolors": "^2.0.0"
69
+ },
70
+ "engines": {
71
+ "node": "^18.19.0 || >=20.5.0"
72
+ },
73
+ "funding": {
74
+ "url": "https://github.com/sindresorhus/execa?sponsor=1"
75
+ }
76
+ },
77
+ "node_modules/figures": {
78
+ "version": "6.1.0",
79
+ "resolved": "https://registry.npmjs.org/figures/-/figures-6.1.0.tgz",
80
+ "integrity": "sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==",
81
+ "license": "MIT",
82
+ "dependencies": {
83
+ "is-unicode-supported": "^2.0.0"
84
+ },
85
+ "engines": {
86
+ "node": ">=18"
87
+ },
88
+ "funding": {
89
+ "url": "https://github.com/sponsors/sindresorhus"
90
+ }
91
+ },
92
+ "node_modules/get-stream": {
93
+ "version": "9.0.1",
94
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-9.0.1.tgz",
95
+ "integrity": "sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA==",
96
+ "license": "MIT",
97
+ "dependencies": {
98
+ "@sec-ant/readable-stream": "^0.4.1",
99
+ "is-stream": "^4.0.1"
100
+ },
101
+ "engines": {
102
+ "node": ">=18"
103
+ },
104
+ "funding": {
105
+ "url": "https://github.com/sponsors/sindresorhus"
106
+ }
107
+ },
108
+ "node_modules/human-signals": {
109
+ "version": "8.0.0",
110
+ "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-8.0.0.tgz",
111
+ "integrity": "sha512-/1/GPCpDUCCYwlERiYjxoczfP0zfvZMU/OWgQPMya9AbAE24vseigFdhAMObpc8Q4lc/kjutPfUddDYyAmejnA==",
112
+ "license": "Apache-2.0",
113
+ "engines": {
114
+ "node": ">=18.18.0"
115
+ }
116
+ },
117
+ "node_modules/is-plain-obj": {
118
+ "version": "4.1.0",
119
+ "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz",
120
+ "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==",
121
+ "license": "MIT",
122
+ "engines": {
123
+ "node": ">=12"
124
+ },
125
+ "funding": {
126
+ "url": "https://github.com/sponsors/sindresorhus"
127
+ }
128
+ },
129
+ "node_modules/is-stream": {
130
+ "version": "4.0.1",
131
+ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-4.0.1.tgz",
132
+ "integrity": "sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==",
133
+ "license": "MIT",
134
+ "engines": {
135
+ "node": ">=18"
136
+ },
137
+ "funding": {
138
+ "url": "https://github.com/sponsors/sindresorhus"
139
+ }
140
+ },
141
+ "node_modules/is-unicode-supported": {
142
+ "version": "2.1.0",
143
+ "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz",
144
+ "integrity": "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==",
145
+ "license": "MIT",
146
+ "engines": {
147
+ "node": ">=18"
148
+ },
149
+ "funding": {
150
+ "url": "https://github.com/sponsors/sindresorhus"
151
+ }
152
+ },
153
+ "node_modules/isexe": {
154
+ "version": "2.0.0",
155
+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
156
+ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
157
+ "license": "ISC"
158
+ },
159
+ "node_modules/npm-run-path": {
160
+ "version": "6.0.0",
161
+ "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-6.0.0.tgz",
162
+ "integrity": "sha512-9qny7Z9DsQU8Ou39ERsPU4OZQlSTP47ShQzuKZ6PRXpYLtIFgl/DEBYEXKlvcEa+9tHVcK8CF81Y2V72qaZhWA==",
163
+ "license": "MIT",
164
+ "dependencies": {
165
+ "path-key": "^4.0.0",
166
+ "unicorn-magic": "^0.3.0"
167
+ },
168
+ "engines": {
169
+ "node": ">=18"
170
+ },
171
+ "funding": {
172
+ "url": "https://github.com/sponsors/sindresorhus"
173
+ }
174
+ },
175
+ "node_modules/npm-run-path/node_modules/path-key": {
176
+ "version": "4.0.0",
177
+ "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz",
178
+ "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==",
179
+ "license": "MIT",
180
+ "engines": {
181
+ "node": ">=12"
182
+ },
183
+ "funding": {
184
+ "url": "https://github.com/sponsors/sindresorhus"
185
+ }
186
+ },
187
+ "node_modules/parse-ms": {
188
+ "version": "4.0.0",
189
+ "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-4.0.0.tgz",
190
+ "integrity": "sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==",
191
+ "license": "MIT",
192
+ "engines": {
193
+ "node": ">=18"
194
+ },
195
+ "funding": {
196
+ "url": "https://github.com/sponsors/sindresorhus"
197
+ }
198
+ },
199
+ "node_modules/path-key": {
200
+ "version": "3.1.1",
201
+ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
202
+ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
203
+ "license": "MIT",
204
+ "engines": {
205
+ "node": ">=8"
206
+ }
207
+ },
208
+ "node_modules/pretty-ms": {
209
+ "version": "9.2.0",
210
+ "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-9.2.0.tgz",
211
+ "integrity": "sha512-4yf0QO/sllf/1zbZWYnvWw3NxCQwLXKzIj0G849LSufP15BXKM0rbD2Z3wVnkMfjdn/CB0Dpp444gYAACdsplg==",
212
+ "license": "MIT",
213
+ "dependencies": {
214
+ "parse-ms": "^4.0.0"
215
+ },
216
+ "engines": {
217
+ "node": ">=18"
218
+ },
219
+ "funding": {
220
+ "url": "https://github.com/sponsors/sindresorhus"
221
+ }
222
+ },
223
+ "node_modules/shebang-command": {
224
+ "version": "2.0.0",
225
+ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
226
+ "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
227
+ "license": "MIT",
228
+ "dependencies": {
229
+ "shebang-regex": "^3.0.0"
230
+ },
231
+ "engines": {
232
+ "node": ">=8"
233
+ }
234
+ },
235
+ "node_modules/shebang-regex": {
236
+ "version": "3.0.0",
237
+ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
238
+ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
239
+ "license": "MIT",
240
+ "engines": {
241
+ "node": ">=8"
242
+ }
243
+ },
244
+ "node_modules/signal-exit": {
245
+ "version": "4.1.0",
246
+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
247
+ "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
248
+ "license": "ISC",
249
+ "engines": {
250
+ "node": ">=14"
251
+ },
252
+ "funding": {
253
+ "url": "https://github.com/sponsors/isaacs"
254
+ }
255
+ },
256
+ "node_modules/strip-final-newline": {
257
+ "version": "4.0.0",
258
+ "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-4.0.0.tgz",
259
+ "integrity": "sha512-aulFJcD6YK8V1G7iRB5tigAP4TsHBZZrOV8pjV++zdUwmeV8uzbY7yn6h9MswN62adStNZFuCIx4haBnRuMDaw==",
260
+ "license": "MIT",
261
+ "engines": {
262
+ "node": ">=18"
263
+ },
264
+ "funding": {
265
+ "url": "https://github.com/sponsors/sindresorhus"
266
+ }
267
+ },
268
+ "node_modules/unicorn-magic": {
269
+ "version": "0.3.0",
270
+ "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.3.0.tgz",
271
+ "integrity": "sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==",
272
+ "license": "MIT",
273
+ "engines": {
274
+ "node": ">=18"
275
+ },
276
+ "funding": {
277
+ "url": "https://github.com/sponsors/sindresorhus"
278
+ }
279
+ },
280
+ "node_modules/which": {
281
+ "version": "2.0.2",
282
+ "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
283
+ "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
284
+ "license": "ISC",
285
+ "dependencies": {
286
+ "isexe": "^2.0.0"
287
+ },
288
+ "bin": {
289
+ "node-which": "bin/node-which"
290
+ },
291
+ "engines": {
292
+ "node": ">= 8"
293
+ }
294
+ },
295
+ "node_modules/yoctocolors": {
296
+ "version": "2.1.1",
297
+ "resolved": "https://registry.npmjs.org/yoctocolors/-/yoctocolors-2.1.1.tgz",
298
+ "integrity": "sha512-GQHQqAopRhwU8Kt1DDM8NjibDXHC8eoh1erhGAJPEyveY9qqVeXvVikNKrDz69sHowPMorbPUrH/mx8c50eiBQ==",
299
+ "license": "MIT",
300
+ "engines": {
301
+ "node": ">=18"
302
+ },
303
+ "funding": {
304
+ "url": "https://github.com/sponsors/sindresorhus"
305
+ }
306
+ }
307
+ }
308
+ }
@@ -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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotpi/module",
3
- "version": "1.10.1",
3
+ "version": "1.11.1",
4
4
  "description": "dotpi module management",
5
5
  "type": "module",
6
6
  "exports": {
@@ -10,6 +10,8 @@
10
10
  "dependencies": {
11
11
  "@dotpi/javascript": "^1.6.3",
12
12
  "execa": "^9.5.2",
13
- "globby": "^14.0.2"
14
- }
13
+ "globby": "^14.0.2",
14
+ "pnpm": "^12.18.0"
15
+ },
16
+ "gitHead": "a0e9b7158609d564e8696a93f6e86c00dcfdf29e"
15
17
  }
@@ -9,6 +9,8 @@ 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 { createRequire } from 'node:module';
13
+
12
14
  export function installCommandDefine({program}) {
13
15
  program
14
16
  .command('install [modules...]')
@@ -90,9 +92,17 @@ export async function install(modules = [], {
90
92
  path.join(dotpiModulesDestination, 'dotpi_modules')
91
93
  );
92
94
 
93
- const moduleDefinition = await definitionGet(moduleToInstall);
94
- const { name: moduleName } = moduleDefinition;
95
+ // Resolve pnpm's package.json, then read its "bin" entry
96
+ const require = createRequire(import.meta.url);
97
+ const pnpmPackagePath = require.resolve('pnpm/package.json');
98
+ const pnpmPackage = require(pnpmPackagePath);
99
+ const pnpmExecutableRelativePath = (typeof pnpmPackage.bin === 'string'
100
+ ? pnpmPackage.bin
101
+ : pnpmPackage.bin.pnpm
102
+ );
103
+ const pnpmExecutable = path.join(path.dirname(pnpmPackagePath), pnpmExecutableRelativePath);
95
104
 
105
+ // There is no prefix for pnpm install, use cwd of command
96
106
  cwd = dotpiModulesDestination;
97
107
  output = await $({
98
108
  cwd,
@@ -100,10 +110,10 @@ export async function install(modules = [], {
100
110
  verbose: (verbose === 'full' ? 'full' : 'none'),
101
111
  // full install with postinstall scripts for each request
102
112
  })`
103
- npx pnpm install
104
- --prod
105
- --dangerously-allow-all-builds
106
- --
113
+ ${pnpmExecutable} install
114
+ --prod
115
+ --dangerously-allow-all-builds
116
+ --
107
117
  ${moduleToInstall}
108
118
  `;
109
119
 
@@ -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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotpi/module-module",
3
- "version": "1.10.1",
3
+ "version": "1.11.1",
4
4
  "description": "dotpi module management",
5
5
  "type": "module",
6
6
  "bin": "./bin/dotpi_module",
@@ -11,7 +11,8 @@
11
11
  "license": "BSD-3-clause",
12
12
  "dependencies": {
13
13
  "@dotpi/javascript": "^1.6.3",
14
- "@dotpi/module": "^1.10.1",
14
+ "@dotpi/module": "^1.11.1",
15
15
  "commander": "^12.1.0"
16
- }
16
+ },
17
+ "gitHead": "a0e9b7158609d564e8696a93f6e86c00dcfdf29e"
17
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotpi/tools",
3
- "version": "2.11.6",
3
+ "version": "2.12.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.10.1",
40
+ "@dotpi/module": "^1.11.1",
41
41
  "chalk": "^5.3.0",
42
42
  "commander": "^12.1.0",
43
43
  "prompts": "^2.4.2",
@@ -45,5 +45,6 @@
45
45
  },
46
46
  "devDependencies": {
47
47
  "lerna": "^8.2.4"
48
- }
48
+ },
49
+ "gitHead": "a0e9b7158609d564e8696a93f6e86c00dcfdf29e"
49
50
  }
package/src/tmp/ssh.sh DELETED
@@ -1,111 +0,0 @@
1
- #!/bin/bash
2
-
3
- # WARNING - this script is probably very Mac specific
4
-
5
- source ".soundpi/helpers.bash"
6
-
7
- # https://www.baeldung.com/linux/use-command-line-arguments-in-bash-script#flags
8
- while getopts p: flag
9
- do
10
- case "${flag}" in
11
- p) project=${OPTARG};;
12
- esac
13
- done
14
-
15
- if [[ -z "$project" ]]
16
- then
17
- config_file="soundpi.conf"
18
- else
19
- config_file="soundpi-${project}.conf"
20
- fi
21
-
22
- title "
23
- - project: ${project}
24
- - use config file: ${config_file}"
25
-
26
- source "${config_file}"
27
-
28
- title "Setting up SSH keys locally for project ${project_name}"
29
-
30
- id_rsa_name="id_rsa_${project_name//-/_}"
31
-
32
- # create ssh keys
33
- section "creating SSH key ${id_rsa_project}"
34
-
35
- if [[ ! -f "ssh/keys/${id_rsa_name}" ]]
36
- then
37
- mkdir -p ssh/keys/
38
- ssh-keygen -f ssh/keys/${id_rsa_name} -t rsa -b 4096 -q -N ""
39
- else
40
- comment "SSH key exists, skip..."
41
- fi
42
-
43
- # create ssh config file
44
- section "generating SSH config file for project ${project_name}"
45
-
46
- if [[ ! -f "ssh/config.d/${project_name}" ]]
47
- then
48
- echo "# generated by soundpi
49
- Host ${project_name}-*.local
50
- IgnoreUnknown AddKeysToAgent,UseKeychain
51
- UseKeychain yes
52
- AddKeysToAgent yes
53
- StrictHostKeyChecking no
54
- UserKnownHostsFile=/dev/null
55
- IdentityFile ~/.ssh/${id_rsa_name}
56
- User pi
57
- " > "ssh/config.d/${project_name}"
58
- else
59
- comment "SSH config file exists, skip..."
60
- fi
61
-
62
- # copy keys to .ssh
63
- section "copying SSH keys into ~/.ssh"
64
-
65
- if [[ ! -f ~/.ssh/${id_rsa_name} || ! -f ~/.ssh/${id_rsa_name}.pub ]]
66
- then
67
- cp ssh/keys/${id_rsa_name} ~/.ssh/
68
- cp ssh/keys/${id_rsa_name}.pub ~/.ssh/
69
- # change rights on private key
70
- chmod 600 ~/.ssh/keys/${id_rsa_name}
71
- else
72
- comment "SSH keys found in ~/.ssh, skip..."
73
- fi
74
-
75
- section "copy SSH config file into ~/.ssh/config.d"
76
-
77
- mkdir -p ~/.ssh/config.d
78
-
79
- # copy the raspberry pi default config file that defines known_hosts file to /dev/null
80
- if [[ ! -f ~/.ssh/config.d/raspberrypi ]]
81
- then
82
- comment "copy raspberrypi config file to ~/.ssh/config.d"
83
- cp "ssh/config.d/raspberrypi" ~/.ssh/config.d/
84
- fi
85
-
86
- if [[ ! -f ~/.ssh/config.d/${project_name} ]]
87
- then
88
- comment "copy ${project_name} config file to ~/.ssh/config.d"
89
- cp "ssh/config.d/${project_name}" ~/.ssh/config.d/
90
- else
91
- comment "config file found in ~/.ssh/config.d, skip..."
92
- fi
93
-
94
-
95
- section "import config files into ~/.ssh/config"
96
-
97
- if [[ ! -f ~/.ssh/config ]]
98
- then
99
- comment "no ~/.ssh/config file found, creating ~/.ssh/config"
100
- touch ~/.ssh/config
101
- fi
102
-
103
- included=$(cat ~/.ssh/config | grep "Include config.d/*")
104
-
105
- if [ -z "$included" ]
106
- then
107
- comment "config files not included, prepending \"Include config.d/*\" into ~/.ssh/config"
108
- printf '%s\n\n%s\n' "Include config.d/*" "$(cat ~/.ssh/config)" > ~/.ssh/config
109
- else
110
- comment "config.d/* included, skip..."
111
- fi