![]() "echo ' \\$Elapsed:$launch_style_normal $launch_time_elapsed " "echo ' \\$npm_package_version ' : '$npm_package_version' ", Use a backslash in the script command, to escaping variables. Run: npm start build-stuff:param1:param2 arg1 arg2 arg3 Output:. ![]() "myFunc:$myParam1:funcParam funcArg $1 ", "echo Function Parameter 2: $funcParam2 ", "echo Function Parameter 1: $funcParam1 ", Parameters are accessed by their name, for example: $project Parameters: These are for passing a fixed set of values to a function.Arguments are accessed by a number, for example: $1 Function arguments: These are values passed from scripts to a function.Command arguments: These are values passed from the command line that was used to start the script, for example: npm start build my-arg1 my-arg2.Launch arguments: These are values passed to laucher directly, for example: launch init or launch version.Launch arguments, command arguments, parameters and arguments Run: npm start build-stuff arg1 ARG2 arg3 Output: app-uva Run: npm start build-stuff arg1 arg2 arg3 or npm start echo arg1 arg2 arg3 Output: Package version: 1.37.3Įnvironment String Manipulation and Expanding Variables Patternįind and replace (only replace first occurrence) So $node_version corresponds to $npm_config_node_version In this example node will be an alias for $npm_config_node. "echo Package version: $npm_package_version ", "echo Package version: $package_version ", With script-launcher you have the benefits of using variables, script references and many more features, so you can make the above example easier to maintain: "deploy:prd": "npm run deploy:uva:prd & npm run deploy:hva:prd " "deploy:acc": "npm run deploy:uva:acc & npm run deploy:hva:acc ", "deploy:tst": "npm run deploy:uva:tst & npm run deploy:hva:tst ", "deploy:dev": "npm run deploy:uva:dev & npm run deploy:hva:dev ", "deploy:hva:prd": "npm run build:hva:prd & firebase deploy -public dist/hva -project status-hva-prd ", "deploy:hva:acc": "npm run build:hva:acc & firebase deploy -public dist/hva -project status-hva-acc ", "deploy:hva:tst": "npm run build:hva:tst & firebase deploy -public dist/hva -project status-hva-tst ", "deploy:hva:dev": "npm run build:hva:dev & firebase deploy -public dist/hva -project status-hva-dev ", "deploy:uva:prd": "npm run build:uva:prd & firebase deploy -public dist/uva -project status-uva-prd ", "deploy:uva:acc": "npm run build:uva:acc & firebase deploy -public dist/uva -project status-uva-acc ", ![]() "deploy:uva:tst": "npm run build:uva:tst & firebase deploy -public dist/uva -project status-uva-tst ", "deploy:uva:dev": "npm run build:uva:dev & firebase deploy -public dist/uva -project status-uva-dev ", "build:hva:prd": "ng build hva -c=prd -prod ", "build:hva:acc": "ng build hva -c=acc -prod ", "build:hva:tst": "ng build hva -c=tst -prod ", "build:hva:dev": "ng build hva -c=dev -prod ", "build:uva:prd": "ng build uva -c=prd -prod ", "build:uva:acc": "ng build uva -c=acc -prod ", "build:uva:tst": "ng build uva -c=tst -prod ", "build:uva:dev": "ng build uva -c=dev -prod ", ![]() Install script-launcher as a development dependency in your project. Environment values and special commands.Launch arguments, command arguments, parameters and arguments.Environment String Manipulation and Expanding Variables.Environment and command line argument values.The features of Script Launcher are specialized in such a way, that working with Mac, Linux and Windows can be seamless experience. Enhance your package.json scripts with features like: menus, functions, arrays, concurrency and many more. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |