File tree Expand file tree Collapse file tree 1 file changed +41
-1
lines changed
Expand file tree Collapse file tree 1 file changed +41
-1
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22
3+
4+
5+ # Adapted from:
6+ #
7+ # - [How can I handle command-line options and arguments in my script easily? - BashFAQ/035 - Greg's Wiki](http://mywiki.wooledge.org/BashFAQ/035)
8+
9+ die () {
10+ printf ' %s\n' " $1 " >&2
11+ exit 1
12+ }
13+
14+ # Initialize all the option variables.
15+ # This ensures we are not contaminated by variables from the environment.
16+ should_publish=false
17+
18+ while : ; do
19+ case $1 in
20+ --publish)
21+ should_publish=true
22+ ;;
23+ --) # End of all options
24+ shift
25+ break
26+ ;;
27+ -?* )
28+ message=$( printf ' ERROR: Unknown option: %s\n' " $1 " )
29+ die " $message "
30+ ;;
31+ * ) # Default case: No more options, so break out of the loop.
32+ break
33+ esac
34+
35+ shift
36+ done
37+
38+
39+
340Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
441export DISPLAY=:99.0
542export DEBUG=electron-installer-snap:snapcraft
643sleep 5
744
845yarn install --force
946yarn run production
10- yarn run publish
47+
48+ if [[ " $should_publish " = true ]]; then
49+ yarn run publish
50+ fi
You can’t perform that action at this time.
0 commit comments