Skip to content

Commit

Permalink
xtask: add npm ci step to package and install
Browse files Browse the repository at this point in the history
  • Loading branch information
SpontanCombust committed Jan 27, 2024
1 parent 39c378b commit 1656e48
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions xtask/src/commands/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ pub fn install() -> anyhow::Result<()> {

if cfg!(unix) {
cmd!(sh, "npm --version").run().with_context(|| "npm is required")?;
cmd!(sh, "vsce --version").run().with_context(|| "vsce is required: npm install -g vsce")?;
cmd!(sh, "code --version").run().with_context(|| "Visual Studio Code is required")?;

cmd!(sh, "npm ci").run()?;
cmd!(sh, "npm run package").run()?;

} else {
cmd!(sh, "cmd.exe /c npm --version").run().with_context(|| "npm is required")?;
cmd!(sh, "cmd.exe /c vsce --version").run().with_context(|| "vsce is required: npm install -g vsce")?;
cmd!(sh, "cmd.exe /c code --version").run().with_context(|| "Visual Studio Code is required")?;

cmd!(sh, "cmd.exe /c npm ci").run()?;
cmd!(sh, "cmd.exe /c npm run package").run()?;
}

Expand Down
4 changes: 2 additions & 2 deletions xtask/src/commands/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ pub fn package(output_dir: Option<String>) -> anyhow::Result<()> {

if cfg!(unix) {
cmd!(sh, "npm --version").run().with_context(|| "npm is required")?;
cmd!(sh, "vsce --version").run().with_context(|| "vsce is required: npm install -g vsce")?;

cmd!(sh, "npm ci").run()?;
cmd!(sh, "npm run package").run()?;
} else {
cmd!(sh, "cmd.exe /c npm --version").run().with_context(|| "npm is required")?;
cmd!(sh, "cmd.exe /c vsce --version").run().with_context(|| "vsce is required: npm install -g vsce")?;

cmd!(sh, "cmd.exe /c npm ci").run()?;
cmd!(sh, "cmd.exe /c npm run package").run()?;
}

Expand Down

0 comments on commit 1656e48

Please sign in to comment.