Skip to content

Commit a9ad171

Browse files
committed
Fix bash script EOL
1 parent c629867 commit a9ad171

File tree

1 file changed

+101
-101
lines changed

1 file changed

+101
-101
lines changed

build.sh

Lines changed: 101 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -12,104 +12,104 @@ NUGET_URL=https://dist.nuget.org/win-x86-commandline/v4.0.0/nuget.exe
1212
FAKE_VERSION=4.61.2
1313
FAKE_EXE=$TOOLS_DIR/FAKE/tools/FAKE.exe
1414
DOTNET_VERSION=3.1.100
15-
DOTNET_INSTALLER_URL=https://dot.net/v1/dotnet-install.sh
16-
DOTNET_CHANNEL=LTS;
17-
DOCFX_VERSION=2.40.5
18-
DOCFX_EXE=$TOOLS_DIR/docfx.console/tools/docfx.exe
19-
20-
# Define default arguments.
21-
TARGET="Default"
22-
CONFIGURATION="Release"
23-
VERBOSITY="verbose"
24-
DRYRUN=
25-
SCRIPT_ARGUMENTS=()
26-
27-
# Parse arguments.
28-
for i in "$@"; do
29-
case $1 in
30-
-t|--target) TARGET="$2"; shift ;;
31-
-c|--configuration) CONFIGURATION="$2"; shift ;;
32-
-v|--verbosity) VERBOSITY="$2"; shift ;;
33-
-d|--dryrun) DRYRUN="-dryrun" ;;
34-
--) shift; SCRIPT_ARGUMENTS+=("$@"); break ;;
35-
*) SCRIPT_ARGUMENTS+=("$1") ;;
36-
esac
37-
shift
38-
done
39-
40-
# Make sure the tools folder exist.
41-
if [ ! -d "$TOOLS_DIR" ]; then
42-
mkdir "$TOOLS_DIR"
43-
fi
44-
45-
###########################################################################
46-
# INSTALL NUGET
47-
###########################################################################
48-
49-
# Download NuGet if it does not exist.
50-
if [ ! -f "$NUGET_EXE" ]; then
51-
echo "Downloading NuGet..."
52-
curl -Lsfo "$NUGET_EXE" $NUGET_URL
53-
if [ $? -ne 0 ]; then
54-
echo "An error occured while downloading nuget.exe."
55-
exit 1
56-
fi
57-
fi
58-
59-
###########################################################################
60-
# INSTALL FAKE
61-
###########################################################################
62-
63-
if [ ! -f "$FAKE_EXE" ]; then
64-
mono "$NUGET_EXE" install Fake -ExcludeVersion -Version $FAKE_VERSION -OutputDirectory "$TOOLS_DIR"
65-
if [ $? -ne 0 ]; then
66-
echo "An error occured while installing Cake."
67-
exit 1
68-
fi
69-
fi
70-
71-
# Make sure that Fake has been installed.
72-
if [ ! -f "$FAKE_EXE" ]; then
73-
echo "Could not find Fake.exe at '$FAKE_EXE'."
74-
exit 1
75-
fi
76-
77-
###########################################################################
78-
# INSTALL DOCFX
79-
###########################################################################
80-
if [ ! -f "$DOCFX_EXE" ]; then
81-
mono "$NUGET_EXE" install docfx.console -ExcludeVersion -Version $DOCFX_VERSION -OutputDirectory "$TOOLS_DIR"
82-
if [ $? -ne 0 ]; then
83-
echo "An error occured while installing DocFx."
84-
exit 1
85-
fi
86-
fi
87-
88-
# Make sure that DocFx has been installed.
89-
if [ ! -f "$DOCFX_EXE" ]; then
90-
echo "Could not find docfx.exe at '$DOCFX_EXE'."
91-
exit 1
92-
fi
93-
94-
###########################################################################
95-
# INSTALL SignTool
96-
###########################################################################
97-
if [ ! -f "$SIGNTOOL_EXE" ]; then
98-
"$SCRIPT_DIR/.dotnet/dotnet" tool install SignClient --version 1.0.82 --tool-path "$SIGNCLIENT_DIR"
99-
if [ $? -ne 0 ]; then
100-
echo "SignClient already installed."
101-
fi
102-
fi
103-
104-
105-
###########################################################################
106-
# WORKAROUND FOR MONO
107-
###########################################################################
108-
export FrameworkPathOverride=/usr/lib/mono/4.5/
109-
110-
###########################################################################
111-
# RUN BUILD SCRIPT
112-
###########################################################################
113-
114-
# Start Fake
115-
exec mono "$FAKE_EXE" build.fsx "${SCRIPT_ARGUMENTS[@]}" --verbosity=$VERBOSITY --configuration=$CONFIGURATION --target=$TARGET $DRYRUN
15+
DOTNET_INSTALLER_URL=https://dot.net/v1/dotnet-install.sh
16+
DOTNET_CHANNEL=LTS;
17+
DOCFX_VERSION=2.40.5
18+
DOCFX_EXE=$TOOLS_DIR/docfx.console/tools/docfx.exe
19+
20+
# Define default arguments.
21+
TARGET="Default"
22+
CONFIGURATION="Release"
23+
VERBOSITY="verbose"
24+
DRYRUN=
25+
SCRIPT_ARGUMENTS=()
26+
27+
# Parse arguments.
28+
for i in "$@"; do
29+
case $1 in
30+
-t|--target) TARGET="$2"; shift ;;
31+
-c|--configuration) CONFIGURATION="$2"; shift ;;
32+
-v|--verbosity) VERBOSITY="$2"; shift ;;
33+
-d|--dryrun) DRYRUN="-dryrun" ;;
34+
--) shift; SCRIPT_ARGUMENTS+=("$@"); break ;;
35+
*) SCRIPT_ARGUMENTS+=("$1") ;;
36+
esac
37+
shift
38+
done
39+
40+
# Make sure the tools folder exist.
41+
if [ ! -d "$TOOLS_DIR" ]; then
42+
mkdir "$TOOLS_DIR"
43+
fi
44+
45+
###########################################################################
46+
# INSTALL NUGET
47+
###########################################################################
48+
49+
# Download NuGet if it does not exist.
50+
if [ ! -f "$NUGET_EXE" ]; then
51+
echo "Downloading NuGet..."
52+
curl -Lsfo "$NUGET_EXE" $NUGET_URL
53+
if [ $? -ne 0 ]; then
54+
echo "An error occured while downloading nuget.exe."
55+
exit 1
56+
fi
57+
fi
58+
59+
###########################################################################
60+
# INSTALL FAKE
61+
###########################################################################
62+
63+
if [ ! -f "$FAKE_EXE" ]; then
64+
mono "$NUGET_EXE" install Fake -ExcludeVersion -Version $FAKE_VERSION -OutputDirectory "$TOOLS_DIR"
65+
if [ $? -ne 0 ]; then
66+
echo "An error occured while installing Cake."
67+
exit 1
68+
fi
69+
fi
70+
71+
# Make sure that Fake has been installed.
72+
if [ ! -f "$FAKE_EXE" ]; then
73+
echo "Could not find Fake.exe at '$FAKE_EXE'."
74+
exit 1
75+
fi
76+
77+
###########################################################################
78+
# INSTALL DOCFX
79+
###########################################################################
80+
if [ ! -f "$DOCFX_EXE" ]; then
81+
mono "$NUGET_EXE" install docfx.console -ExcludeVersion -Version $DOCFX_VERSION -OutputDirectory "$TOOLS_DIR"
82+
if [ $? -ne 0 ]; then
83+
echo "An error occured while installing DocFx."
84+
exit 1
85+
fi
86+
fi
87+
88+
# Make sure that DocFx has been installed.
89+
if [ ! -f "$DOCFX_EXE" ]; then
90+
echo "Could not find docfx.exe at '$DOCFX_EXE'."
91+
exit 1
92+
fi
93+
94+
###########################################################################
95+
# INSTALL SignTool
96+
###########################################################################
97+
if [ ! -f "$SIGNTOOL_EXE" ]; then
98+
"$SCRIPT_DIR/.dotnet/dotnet" tool install SignClient --version 1.0.82 --tool-path "$SIGNCLIENT_DIR"
99+
if [ $? -ne 0 ]; then
100+
echo "SignClient already installed."
101+
fi
102+
fi
103+
104+
105+
###########################################################################
106+
# WORKAROUND FOR MONO
107+
###########################################################################
108+
export FrameworkPathOverride=/usr/lib/mono/4.5/
109+
110+
###########################################################################
111+
# RUN BUILD SCRIPT
112+
###########################################################################
113+
114+
# Start Fake
115+
exec mono "$FAKE_EXE" build.fsx "${SCRIPT_ARGUMENTS[@]}" --verbosity=$VERBOSITY --configuration=$CONFIGURATION --target=$TARGET $DRYRUN

0 commit comments

Comments
 (0)