source: trip-planner-front/node_modules/npm-packlist/bin/index.js@ 76712b2

Last change on this file since 76712b2 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 662 bytes
Line 
1#!/usr/bin/env node
2
3const dirs = []
4let doSort = false
5process.argv.slice(2).forEach(arg => {
6 if (arg === '-h' || arg === '--help') {
7 console.log('usage: npm-packlist [-s --sort] [directory, directory, ...]')
8 process.exit(0)
9 } else if (arg === '-s' || arg === '--sort')
10 doSort = true
11 else
12 dirs.push(arg)
13})
14
15const sort = list => doSort ? list.sort((a, b) => a.localeCompare(b, 'en')) : list
16
17const packlist = require('../')
18if (!dirs.length)
19 console.log(sort(packlist.sync({ path: process.cwd() })).join('\n'))
20else {
21 dirs.forEach(path => {
22 console.log(`> ${path}`)
23 console.log(sort(packlist.sync({ path })).join('\n'))
24 })
25}
Note: See TracBrowser for help on using the repository browser.