-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add show-args sub-command to Compose
- Loading branch information
1 parent
6212b05
commit 6255476
Showing
4 changed files
with
93 additions
and
85 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { Command } from 'commander'; | ||
import { projectConfig } from '../../config/project'; | ||
import { composeExecParams, composeFiles } from '../../utils/compose'; | ||
import log from '../../utils/log'; | ||
|
||
export const composeShowArgsCommand = () => { | ||
const command = new Command(); | ||
const config = projectConfig(); | ||
|
||
command | ||
.name('show-args') | ||
.summary('Show args for DEMS-custom Compose command') | ||
.description( | ||
'Prints to console all the flags and arguments used for the custom\n' + | ||
'docker compose command for DEMS.', | ||
) | ||
.action(() => { | ||
log.info('Compose command params:') | ||
console.log(JSON.stringify(composeExecParams(), null, 2)); | ||
log.info('Compose files params:') | ||
console.log(JSON.stringify(composeFiles({}), null, 2)); | ||
}); | ||
|
||
return command; | ||
}; | ||
|
||
export default composeShowArgsCommand(); | ||
|
||
// Execute script only if called directly | ||
if (import.meta.path === Bun.main) { | ||
composeShowArgsCommand().parse(); | ||
} |
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