From d2d43ee71149190829f4947fac8284c2d321aea5 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Mon, 2 May 2022 12:57:36 -0300 Subject: [PATCH] Added GitHub action option to use --quick-start --- action.yml | 5 +++++ entrypoint.sh | 22 +++++++++++++++------- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/action.yml b/action.yml index 81147118..49e18a48 100644 --- a/action.yml +++ b/action.yml @@ -23,6 +23,10 @@ inputs: description: 'The schematic file (.sch) [default: first *.*sch found]' required: false default: '__SCAN__' + quickstart: + description: 'Scans for projects and generates configs and outputs, use YES [default: NO]' + required: false + default: 'NO' skip: description: 'Skip preflights, comma separated or "all" [default: no skip]' required: false @@ -47,6 +51,7 @@ runs: - -d ${{ inputs.dir }} - -b ${{ inputs.board }} - -e ${{ inputs.schema }} + - -q ${{ inputs.quickstart }} - -s ${{ inputs.skip }} - -t ${{ inputs.targets }} - -v ${{ inputs.verbose }} diff --git a/entrypoint.sh b/entrypoint.sh index 3912505b..277c79d1 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -11,6 +11,7 @@ SKIP="" DIR="" VARIANT="" TARGETS="" +QUICKSTART="" # Exit error code EXIT_ERROR=1 @@ -26,7 +27,7 @@ function msg_usage { function msg_disclaimer { echo -e "This is free software: you are free to change and redistribute it" echo -e "There is NO WARRANTY, to the extent permitted by law.\n" - echo -e "See ." + echo -e "See ." } function msg_illegal_arg { @@ -34,18 +35,17 @@ function msg_illegal_arg { } function msg_help { - echo -e "Mandatory arguments:" + echo -e "\nOptional control arguments:" echo -e " -c, --config FILE .kibot.yaml config file" - - echo -e "\nOptional control arguments:" echo -e " -d, --dir DIR output path. Default: current dir, will be used as prefix of dir configured in config file" echo -e " -b, --board FILE .kicad_pcb board file. Use __SCAN__ to get the first board file found in current folder." echo -e " -e, --schema FILE .sch schematic file. Use __SCAN__ to get the first schematic file found in current folder." + echo -e " -q, --quick-start YES generate configs and outputs automagically (-b, -e, -s, -V, -c are ignored)." echo -e " -s, --skip Skip preflights, comma separated or 'all'" echo -e " -t, --targets List of targets to generate separated by spaces. To only run preflights use __NONE__." echo -e " -V, --variant Global variant" - echo -e "\nMiscellaneous:" + echo -e "\nMiscellaneous:" echo -e " -v, --verbose annotate program execution" echo -e " -h, --help display this message and exit" } @@ -125,6 +125,9 @@ function args_process { -d | --dir) shift DIR="-d $1" ;; + -q | --quick-start) shift + QUICKSTART="$1" + ;; -s | --skip) shift if [ "$1" == "__NONE__" ]; then SKIP="" @@ -163,8 +166,13 @@ function run { /usr/bin/kicad-git-filters.py fi - echo $CONFIG $DIR $BOARD $SCHEMA $SKIP $VERBOSE $VARIANT $TARGETS - kibot $CONFIG $DIR $BOARD $SCHEMA $SKIP $VERBOSE $VARIANT $TARGETS + if [ QUICKSTART == "YES" ]; then + echo $DIR $VERBOSE --quick-start + kibot $DIR $VERBOSE --quick-start + else + echo $CONFIG $DIR $BOARD $SCHEMA $SKIP $VERBOSE $VARIANT $TARGETS + kibot $CONFIG $DIR $BOARD $SCHEMA $SKIP $VERBOSE $VARIANT $TARGETS + fi } function main {