@@ -4,21 +4,25 @@ import { bold, red, magenta, cyan } from 'chalk';
44import { runScriptAPI } from '../api' ;
55import { dbLogger } from '../util/logger' ;
66import { loadConfig , resolveConnections } from '..' ;
7+ import { validateScriptFileName } from '../util/fs' ;
78import { printLine , printError , printInfo } from '../util/io' ;
89import OperationResult from '../domain/operation/OperationResult' ;
910
1011class RunScript extends Command {
1112 static description = 'Run the provided manual scripts.' ;
1213
14+
1315 static flags = {
1416 'dry-run' : flags . boolean ( { description : 'Dry run script.' , default : false } ) ,
1517 only : flags . string ( {
1618 helpValue : 'CONNECTION_ID(s)' ,
1719 description : 'Filter provided connection(s). Comma separated ids eg: id1,id2'
1820 } ) ,
1921 file : flags . string ( {
22+ required : true ,
2023 helpValue : 'Script Name' ,
21- description : 'Name of the manual SQL/JS/TS script'
24+ parse : validateScriptFileName ,
25+ description : 'Name of the manual SQL/JS/TS script' ,
2226 } ) ,
2327 'connection-resolver' : flags . string ( {
2428 helpValue : 'PATH' ,
@@ -30,6 +34,8 @@ class RunScript extends Command {
3034 } )
3135 } ;
3236
37+
38+
3339 /**
3440 * Started event handler.
3541 */
@@ -110,3 +116,4 @@ class RunScript extends Command {
110116}
111117
112118export default RunScript ;
119+
0 commit comments