Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
refactor: use @bifravst/run
Browse files Browse the repository at this point in the history
  • Loading branch information
coderbyheart committed Apr 3, 2024
1 parent f9b6cc1 commit e771a81
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 48 deletions.
40 changes: 0 additions & 40 deletions cli/run.ts

This file was deleted.

2 changes: 1 addition & 1 deletion feature-runner/run-features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import path from 'path'
import { cliCredentials } from '../cli/cliCredentials.js'
import { progress as logProgress } from '../cli/logging.js'
import { error, heading, settings } from '../cli/logging.js'
import { run } from '../cli/run.js'
import run from '@bifravst/run'
import { deviceStepRunners } from './steps/device.js'
import { httpApiMockStepRunners } from './steps/httpApiMock.js'
const { Registry } = iothub
Expand Down
22 changes: 15 additions & 7 deletions pack/package-function-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { readdir } from 'fs/promises'
import os from 'os'
import path from 'path'
import { debug, progress } from '../cli/logging.js'
import { run } from '../cli/run.js'
import run from '@bifravst/run'
import { copy } from './lib/copy.js'

const installDependenciesFromPackageJSON = async ({
Expand All @@ -29,8 +29,10 @@ const installDependenciesFromPackageJSON = async ({
command: 'npm',
args: ['ci', '--ignore-scripts', '--only=prod', '--no-audit'],
cwd: targetDir,
log: (info) => progress('Installing dependencies', info),
debug: (info) => debug('[npm]', info),
log: {
debug: (info) => progress('Installing dependencies', info),
stdout: (info) => debug('[npm]', info.toString()),
},
})
}

Expand All @@ -42,8 +44,10 @@ export const installPackagesFromList =
command: 'npm',
args: ['i', '--ignore-scripts', '--no-audit', ...packageList],
cwd: targetDir,
log: (info) => progress('Installing dependencies', info),
debug: (info) => debug('[npm]', info),
log: {
debug: (info) => progress('Installing dependencies', info),
stdout: (info) => debug('[npm]', info.toString()),
},
})
}

Expand Down Expand Up @@ -137,14 +141,18 @@ export const packageFunctionApp = async ({
command: 'zip',
args: ['-r', outFile, './'],
cwd: tempDir,
log: (info) => progress('[ZIP]', info),
log: {
stdout: (info) => progress('[ZIP]', info.toString()),
},
})

// Remove the temp folder
await run({
command: 'rm',
args: ['-rf', tempDir],
log: (info) => progress('Cleanup', info),
log: {
stdout: (info) => progress('Cleanup', info.toString()),
},
})

return outFile
Expand Down
15 changes: 15 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
"@azure/functions": "3.5.1",
"@azure/identity": "3.4.2",
"@azure/keyvault-secrets": "4.8.0",
"@bifravst/run": "1.2.0",
"@nordicsemiconductor/from-env": "1.0.3"
}
}

0 comments on commit e771a81

Please sign in to comment.