@eliware/vyops 2.1.0 → 2.1.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/RELEASE_NOTES.md +8 -0
- package/package.json +1 -1
- package/src/bundle.mjs +3 -1
- package/src/deploy.mjs +1 -1
package/RELEASE_NOTES.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Release Notes
|
|
2
2
|
|
|
3
|
+
## 2.1.1
|
|
4
|
+
|
|
5
|
+
- Fix deployment of `.exe` files in the synchronized `scripts/` tree by
|
|
6
|
+
applying executable permissions (`0755`).
|
|
7
|
+
- Treat `.exe` files as binaries during preflight instead of applying
|
|
8
|
+
shell-script shebang and line-ending checks.
|
|
9
|
+
- Add regression coverage for executable `.exe` deployment.
|
|
10
|
+
|
|
3
11
|
## 2.1.0
|
|
4
12
|
|
|
5
13
|
- **Breaking:** Replace the legacy positional deployment and `--dry-run`
|
package/package.json
CHANGED
package/src/bundle.mjs
CHANGED
|
@@ -29,9 +29,11 @@ export async function validateBundle(config, text, { extractTarget = true } = {}
|
|
|
29
29
|
for (const { file, name } of scripts) {
|
|
30
30
|
const data = await fs.readFile(file);
|
|
31
31
|
const firstLine = data.toString('utf8').split(/\n/, 1)[0].replace(/\r$/, '');
|
|
32
|
-
const
|
|
32
|
+
const binary = /\.exe$/i.test(name);
|
|
33
|
+
const executable = binary || firstLine.startsWith('#!') || /(?:\.sh|\.script)$/.test(name)
|
|
33
34
|
|| /^(?:commit\/post-hooks\.d\/|vyos-(?:pre|post)config-bootup\.script$)/.test(name);
|
|
34
35
|
if (!executable) continue;
|
|
36
|
+
if (binary) continue;
|
|
35
37
|
if (data.includes(13)) scriptError(name, 'uses CRLF line endings; convert to LF');
|
|
36
38
|
if (!firstLine.startsWith('#!')) scriptError(name, 'is executable but has no shebang');
|
|
37
39
|
const interpreter = firstLine.slice(2).trim().split(/\s+/, 1)[0];
|
package/src/deploy.mjs
CHANGED
|
@@ -59,7 +59,7 @@ async function installScripts(client, config, log, runId) {
|
|
|
59
59
|
/* istanbul ignore next -- missing files are only possible with a mocked directory listing. */
|
|
60
60
|
if (error.code !== 'ENOENT') throw error;
|
|
61
61
|
}
|
|
62
|
-
const mode = content.toString('utf8').startsWith('#!') || /\.(?:sh|script)
|
|
62
|
+
const mode = content.toString('utf8').startsWith('#!') || /\.(?:sh|script|exe)$/i.test(name)
|
|
63
63
|
|| /^(?:commit[/\\]post-hooks\.d[/\\])/.test(name)
|
|
64
64
|
? 0o755
|
|
65
65
|
: (await fs.promises.stat(local)).mode & 0o777;
|