Skip to content

Commit

Permalink
Fix es6 import
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasG77 committed Apr 4, 2023
1 parent fa02bb5 commit 7c64b8b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import program from 'commander'
const require = createRequire(import.meta.url)
const pkg = require('../package.json')

const BUNDLE_TYPES = require('../lib/bundle-types.js').BUNDLE_TYPES.map(bt => bt.name)
import {BUNDLE_TYPES} from '../lib/bundle-types.js'
const BUNDLE_TYPES_NAMES = BUNDLE_TYPES.map(bt => bt.name)


program
.version(pkg.version)
Expand All @@ -23,8 +25,8 @@ program
if (!archivesDir) throw new Error('archivesDir is required')
archivesDir = resolve(archivesDir)
if (!bundle) throw new Error('--bundle est un paramètre obligatoire')
if (!BUNDLE_TYPES.includes(bundle)) {
throw new Error('Le type de bundle doit être parmi : ' + BUNDLE_TYPES.join(', '))
if (!BUNDLE_TYPES_NAMES.includes(bundle)) {
throw new Error('Le type de bundle doit être parmi : ' + BUNDLE_TYPES_NAMES.join(', '))
}

require('../lib/commands/import-pci.js')(archivesDir, workDir, bundle, image).catch(boom)
Expand Down

0 comments on commit 7c64b8b

Please sign in to comment.