-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
86 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { Command, Option } from 'commander'; | ||
import { extractRadarLinks } from './links'; | ||
import { generateVolumes } from './files'; | ||
import { generateMasterData } from './timeline'; | ||
const program = new Command(); | ||
|
||
program | ||
.name('tech-radar-volumes') | ||
.description('A CLI tool to fetch and process ThoughtWorks Tech Radar data') | ||
.option('-l, --links', 'fetch all radar blip page links from archive') | ||
.option('-d, --data', 'fetch detailed blip history from archive') | ||
.addOption( | ||
new Option( | ||
'-v, --volumes <type>', | ||
'generate CSV and JSON volumes', | ||
).choices(['all', 'csv', 'json']), | ||
); | ||
|
||
program.parse(process.argv); | ||
|
||
const options = program.opts(); | ||
|
||
if (options.links) { | ||
console.log('fetching all radar blip page links from archive'); | ||
extractRadarLinks(); | ||
} else if (options.data) { | ||
console.log('fetching detailed blip history from archive'); | ||
generateMasterData(); | ||
} else if (options.volumes) { | ||
console.log(`generating ${options.volumes} volumes`); | ||
generateVolumes(options.volumes); | ||
} else { | ||
extractRadarLinks().then(() => | ||
generateMasterData().then(() => generateVolumes('all')), | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters