We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cf3210f commit 634f645Copy full SHA for 634f645
script/create-release-vdf.sh
@@ -22,9 +22,14 @@ else
22
fi
23
24
# Check mod description
25
-if [ -f "$3" ]
26
-then
27
- description=$(<"$3" sed -e 's/\\/\\\\/g' -e 's/"/\\"/g')
+if [ -f "$3" ]; then
+ description=$(sed \
+ -e ':a;N;$!ba' \ # slurp entire file
28
+ -e 's/\\/\\\\/g' \ # escape backslashes
29
+ -e 's/"/\\"/g' \ # escape double-quotes
30
+ -e 's/\n/\\n/g' \ # turn real newlines into \n
31
+ "$3")
32
+ printf '\t"description" "%s"\n' "$description" >> workshop.vdf
33
34
35
# Clean up old file
@@ -49,6 +54,6 @@ then
49
54
printf '\t"description" "%s"' "$description" >> workshop.vdf
50
55
printf '\n' >> workshop.vdf
51
56
52
-printf '}' >> workshop.vdf
57
+printf '}\n' >> workshop.vdf
53
58
59
cat workshop.vdf
0 commit comments