Skip to content

Commit

Permalink
🔖 v0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
stoe committed Aug 15, 2023
1 parent daa5b69 commit 7cbc4e5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
14 changes: 9 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
#!/usr/bin/env node

import fs from 'fs'
import {join} from 'path'

import chalk from 'chalk'
import meow from 'meow'
import open from 'open'
import yaml from 'js-yaml'

const {blue, bold, red, yellow} = chalk
const {dim, blue, bold, red, yellow} = chalk
const cli = meow(
`
${bold('Usage')}
${blue(`action-reporting-parse-cli`)} ${yellow(`[options]`)}
${bold('Required options')}
${yellow(`--config`)}, ${yellow(`-c`)} Path to config.yml file.
${yellow(`--data`)}, ${yellow(`-d`)} Path to data directory.
${yellow(`--data`)}, ${yellow(`-d`)} Path to data directory to lookup ${dim('*actions.json')} files in.
${bold('Additional options')}
${yellow(`--open`)}, ${yellow(`-o`)} Open the generated CSV file.
${yellow(`--open`)}, ${yellow(`-o`)} Open the generated CSV file ${dim('(Default: false)')}.
${bold('Helper options')}
${yellow(`--help`)}, ${yellow(`-h`)} Print this help message.
${yellow(`--version`)}, ${yellow(`-v`)} Print the CLI version.`,
${yellow(`--version`)}, ${yellow(`-v`)} Print the CLI version.
${bold.yellow('Note:')} Report CSV file will be saved in ${dim(join(process.cwd(), 'uses.csv'))}`,
{
booleanDefault: undefined,
description: false,
Expand Down Expand Up @@ -82,7 +86,7 @@ const cli = meow(
for (const file of fs.readdirSync(data)) {
if (file.indexOf('actions.json') === -1) continue

const json = JSON.parse(fs.readFileSync(`./data/${file}`, 'utf8'))
const json = JSON.parse(fs.readFileSync(join(data, file), 'utf8'))
actions.push(...json)
}

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stoe/action-reporting-parse-cli",
"version": "0.1.1",
"version": "0.1.2",
"type": "module",
"description": "CLI to parse https://github.com/stoe/action-reporting-cli reports",
"keywords": [
Expand Down
5 changes: 4 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@
$ npx @stoe/action-reporting-parse-cli [--options]
```

> **Note**
> Report CSV file will be saved in `current_directory/uses.csv`.
## Required options

- `--config`, `-c` Path to config.yml file.
- `--data`, `-d` Path to data directory.
- `--data`, `-d` Path to data directory to lookup `*actions.json` files.

## Additional options

Expand Down

0 comments on commit 7cbc4e5

Please sign in to comment.