Skip to content

Commit

Permalink
Use ni to support pnpm and yarn
Browse files Browse the repository at this point in the history
  • Loading branch information
skorfmann committed Nov 4, 2023
1 parent 2f5a019 commit 54883f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions actions/deploy/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,14 @@ async function run(): Promise<void> {

await runCommand('npm', ['install', '-g', `winglang@${version}`])
core.info(`Installed winglang@${version}`)
await runCommand('npm', ['install', '-g', `@antfu/ni`])

// if package.json exists, install dependencies
if (fs.existsSync(path.join(process.cwd(), 'package.json'))) {
await runCommand('npm', ['ci'])
core.info(`Installed NPM dependencies with npm ci`)
await runCommand('ni', ['--frozen'])
core.info(`Installed NPM dependencies with ni --frozen`)
} else {
core.info(`No package.json found, skipping npm ci`)
core.info(`No package.json found, skipping ni --frozen`)
}

const tfEnv: Record<string, string> = {
Expand Down
7 changes: 4 additions & 3 deletions actions/pull-request-diff/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,14 @@ async function run(): Promise<void> {

await runCommand('npm', ['install', '-g', `winglang@${version}`])
core.info(`Installed winglang@${version}`)
await runCommand('npm', ['install', '-g', `@antfu/ni`])

// if package.json exists, install dependencies
if (fs.existsSync(path.join(process.cwd(), 'package.json'))) {
await runCommand('npm', ['ci'])
core.info(`Installed NPM dependencies with npm ci`)
await runCommand('ni', ['--frozen'])
core.info(`Installed NPM dependencies with ni --frozen`)
} else {
core.info(`No package.json found, skipping npm ci`)
core.info(`No package.json found, skipping ni --frozen`)
}

const tfEnv: Record<string, string> = {
Expand Down

0 comments on commit 54883f4

Please sign in to comment.