-
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
235 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@codeowners-flow/cli': patch | ||
--- | ||
|
||
Wrap CLI with cli helper |
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,5 @@ | ||
## Description | ||
|
||
Closes # | ||
|
||
## Changes |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env node | ||
'use strict'; | ||
|
||
require('../dist/index.cjs'); | ||
import('../dist/index.js'); |
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 |
---|---|---|
@@ -1,11 +1,39 @@ | ||
import meow from 'meow'; | ||
|
||
import { generateCodeOwners } from './generate-codeowners.js'; | ||
|
||
generateCodeOwners() | ||
.then(({ ownersPath }) => { | ||
console.log('Codeowners file generated! 🎉'); | ||
console.log(`You can find it at: "${ownersPath}".\n`); | ||
}) | ||
.catch((error) => { | ||
console.error('Error generating CODEOWNERS file:', error); | ||
process.exit(1); | ||
}); | ||
const cli = meow( | ||
` | ||
Usage | ||
$ codeowners-flow generate | ||
Example | ||
$ codeowners-flow generate | ||
CODEOWNERS file generated! 🎉 | ||
You can find it at: "/path/to/CODEOWNERS". | ||
`, | ||
{ | ||
importMeta: import.meta, | ||
}, | ||
); | ||
|
||
const [command] = cli.input; | ||
|
||
switch (command) { | ||
case 'generate': { | ||
generateCodeOwners() | ||
.then(({ ownersPath }) => { | ||
console.log('Codeowners file generated! 🎉'); | ||
console.log(`You can find it at: "${ownersPath}".\n`); | ||
}) | ||
.catch((error) => { | ||
console.error('Error generating CODEOWNERS file:', error); | ||
process.exit(1); | ||
}); | ||
break; | ||
} | ||
default: { | ||
cli.showHelp(); | ||
} | ||
} |
Oops, something went wrong.