File tree Expand file tree Collapse file tree 2 files changed +52
-25
lines changed Expand file tree Collapse file tree 2 files changed +52
-25
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
- die () {
3
- echo " $* " >&2
4
- exit 1
5
- }
6
-
7
2
make_absolute () {
8
3
case " $1 " in
9
4
/* )
@@ -26,20 +21,12 @@ case "$i" in
26
21
CONFIGURATION=" ${i#* =} "
27
22
shift # past argument=value
28
23
;;
29
- --version=* )
30
- VERSION=" ${i#* =} "
31
- shift # past argument=value
32
- ;;
33
24
* )
34
25
# unknown option
35
26
;;
36
27
esac
37
28
done
38
29
39
- if [ -z " $VERSION " ]; then
40
- die " --version was not set"
41
- fi
42
-
43
30
# Directories
44
31
THISDIR=" $( cd " $( dirname " $0 " ) " ; pwd -P ) "
45
32
ROOT=" $( cd " $THISDIR " /../../.. ; pwd -P ) "
@@ -126,15 +113,3 @@ echo "Copying images..."
126
113
cp " $SRC /$DOTNET_TOOL /icon.png" " $IMGOUT " || exit 1
127
114
128
115
echo " Build complete."
129
-
130
- # ####################################################################
131
- # Pack dotnet tool
132
- # ####################################################################
133
- echo " Creating dotnet tool package..."
134
-
135
- dotnet pack " $SRC /$DOTNET_TOOL /DotnetTool.csproj" \
136
- /p:Configuration=" $CONFIGURATION " \
137
- /p:PackageVersion=" $VERSION " \
138
- /p:PublishDir=" $OUTDIR /"
139
-
140
- echo " Dotnet tool pack complete."
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ die () {
3
+ echo " $* " >&2
4
+ exit 1
5
+ }
6
+
7
+ # Parse script arguments
8
+ for i in " $@ "
9
+ do
10
+ case " $i " in
11
+ --configuration=* )
12
+ CONFIGURATION=" ${i#* =} "
13
+ shift # past argument=value
14
+ ;;
15
+ --version=* )
16
+ VERSION=" ${i#* =} "
17
+ shift # past argument=value
18
+ ;;
19
+ --publish-dir=* )
20
+ PUBLISH_DIR=" ${i#* =} "
21
+ shift # past argument=value
22
+ ;;
23
+ * )
24
+ # unknown option
25
+ ;;
26
+ esac
27
+ done
28
+
29
+ CONFIGURATION=" ${CONFIGURATION:= Debug} "
30
+ if [ -z " $VERSION " ]; then
31
+ die " --version was not set"
32
+ fi
33
+
34
+ # Directories
35
+ THISDIR=" $( cd " $( dirname " $0 " ) " ; pwd -P ) "
36
+ ROOT=" $( cd " $THISDIR " /../../.. ; pwd -P ) "
37
+ SRC=" $ROOT /src"
38
+ OUT=" $ROOT /out"
39
+ DOTNET_TOOL=" shared/DotnetTool"
40
+
41
+ if [ -z " $PUBLISH_DIR " ]; then
42
+ PUBLISH_DIR=" $OUT /$DOTNET_TOOL /nupkg/$CONFIGURATION "
43
+ fi
44
+
45
+ echo " Creating dotnet tool package..."
46
+
47
+ dotnet pack " $SRC /$DOTNET_TOOL /DotnetTool.csproj" \
48
+ /p:Configuration=" $CONFIGURATION " \
49
+ /p:PackageVersion=" $VERSION " \
50
+ /p:PublishDir=" $PUBLISH_DIR /"
51
+
52
+ echo " Dotnet tool pack complete."
You can’t perform that action at this time.
0 commit comments