File tree Expand file tree Collapse file tree 7 files changed +110
-2
lines changed
bin/github-apps.configure Expand file tree Collapse file tree 7 files changed +110
-2
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,8 @@ function help(){
1717 echo
1818 echo " Available Commands:"
1919 echo " help help for $0 "
20- echo " bash build bash src"
20+ echo " bash build bash src"
21+ echo " pack pack release"
2122 echo
2223 echo " Flags:"
2324 echo " -h, --help help for $0 "
@@ -32,6 +33,11 @@ case "$1" in
3233 export Command=" $0 bash"
3334 " $BashDir /script/bash.sh" " $@ "
3435 ;;
36+ pack)
37+ shift
38+ export Command=" $0 pack"
39+ " $BashDir /script/pack.sh" " $@ "
40+ ;;
3541 * )
3642 if [[ " $1 " == " " ]]; then
3743 help
Original file line number Diff line number Diff line change @@ -141,4 +141,6 @@ function build_dir
141141 }
142142}
143143cd $Dir
144+ version=" src/github-apps.sh/2.sh"
145+ echo " Apps_Version=\" $Version \" " > " $version "
144146build_dir " $Input "
Original file line number Diff line number Diff line change 11Dir=$( cd " $( dirname $BASH_SOURCE ) /.." && pwd)
2+ Version=" v1.0.0"
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -e
4+
5+ BashDir=$( cd " $( dirname $BASH_SOURCE ) " && pwd)
6+ eval $( cat " $BashDir /conf.sh" )
7+ if [[ " $Command " == " " ]]; then
8+ Command=" $0 "
9+ fi
10+
11+ function help(){
12+ echo " pack platform"
13+ echo
14+ echo " Usage:"
15+ echo " $0 [flags]"
16+ echo
17+ echo " Flags:"
18+ echo " -p, --pack pack to compressed package (default \" gz\" ) [7z gz bz2 xz zip]"
19+ echo " -h, --help help for $0 "
20+ }
21+
22+ ARGS=` getopt -o hp: --long help,pack: -n " $Command " -- " $@ " `
23+ eval set -- " ${ARGS} "
24+ pack=" gz"
25+ while true
26+ do
27+ case " $1 " in
28+ -h|--help)
29+ help
30+ exit 0
31+ ;;
32+ -p|--pack)
33+ case " $2 " in
34+ 7z|gz|bz2|xz|zip)
35+ pack=" $2 "
36+ ;;
37+ * )
38+ echo Error: unknown pack " $2 " for " $Command --pack"
39+ echo " Supported: 7z gz bz2 xz zip"
40+ exit 1
41+ ;;
42+ esac
43+ shift 2
44+ ;;
45+ --)
46+ shift
47+ break
48+ ;;
49+ * )
50+ echo Error: unknown flag " $1 " for " $Command "
51+ echo " Run '$Command --help' for usage."
52+ exit 1
53+ ;;
54+ esac
55+ done
56+
57+
58+ name=" bin"
59+ case " $pack " in
60+ 7z)
61+ name=" $name .7z"
62+ args=(7z a " $name " )
63+ ;;
64+ zip)
65+ name=" $name .zip"
66+ args=(zip -r " $name " )
67+ ;;
68+ gz)
69+ name=" $name .tar.gz"
70+ args=(tar -zcvf " $name " )
71+ ;;
72+ bz2)
73+ name=" $name .tar.bz2"
74+ args=(tar -jcvf " $name " )
75+ ;;
76+ xz)
77+ name=" $name .tar.xz"
78+ args=(tar -Jcvf " $name " )
79+ ;;
80+ esac
81+ if [[ " $args " == " " ]]; then
82+ exit 0
83+ fi
84+ cd " $Dir /bin"
85+ if [[ -f " $name " ]]; then
86+ rm " $name "
87+ fi
88+ source=(
89+ github-apps.sh
90+ github-apps.configure
91+ )
92+ exec=" ${args[@]} ${source[@]} "
93+ echo $exec
94+ eval " $exec >> /dev/null"
95+
96+ exec=" sha256sum $name > $name .sha256"
97+ echo $exec
98+ eval " $exec "
Original file line number Diff line number Diff line change 1+ Apps_Version=" v1.0.0"
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ function appsMain
2828 return 0
2929 ;;
3030 -v|--version)
31- echo " v1.0.0 "
31+ echo " $Apps_Version "
3232 return 0
3333 ;;
3434 completion)
You can’t perform that action at this time.
0 commit comments