Skip to content

Commit 28d94f4

Browse files
authored
fix(install): support --allow-scripts with deno install -g --compile ... (#32249)
1 parent a29b955 commit 28d94f4

File tree

6 files changed

+46
-0
lines changed

6 files changed

+46
-0
lines changed

cli/args/flags.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6587,6 +6587,7 @@ fn install_parse(
65876587

65886588
if compile {
65896589
flags.type_check_mode = TypeCheckMode::Local;
6590+
allow_scripts_arg_parse(flags, matches)?;
65906591
}
65916592

65926593
flags.subcommand =
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env deno
2+
const message = require("./message.js");
3+
console.log(message);
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "@denotest/lifecycle-scripts-simple",
3+
"version": "1.0.0",
4+
"bin": {
5+
"lifecycle-scripts-simple": "./main.js"
6+
},
7+
"scripts": {
8+
"postinstall": "echo 'module.exports = \"postinstall works\";' > message.js"
9+
}
10+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"tempDir": true,
3+
"tests": {
4+
"install_and_run": {
5+
"steps": [{
6+
"if": "unix",
7+
"args": "install -g --compile --allow-scripts --root ./bins --name lifecycle-scripts-simple npm:@denotest/lifecycle-scripts-simple",
8+
"output": "install.out"
9+
}, {
10+
"if": "unix",
11+
"commandName": "./bins/bin/lifecycle-scripts-simple",
12+
"args": [],
13+
"output": "run.out",
14+
"exitCode": 0
15+
}, {
16+
"if": "windows",
17+
"args": "install -g --compile --allow-scripts --root ./bins --name lifecycle-scripts-simple npm:@denotest/lifecycle-scripts-simple",
18+
"output": "install.out"
19+
}, {
20+
"if": "windows",
21+
"commandName": "./bins/bin/lifecycle-scripts-simple.exe",
22+
"args": [],
23+
"output": "run.out",
24+
"exitCode": 0
25+
}]
26+
}
27+
}
28+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[WILDCARD]Initialize @denotest/lifecycle-scripts-simple@1.0.0: running 'postinstall' script
2+
[WILDCARD]Compile[WILDCARD]
3+
[WILDCARD]Successfully installed[WILDCARD]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
postinstall works

0 commit comments

Comments
 (0)