Skip to content

Commit

Permalink
Fix UTF-8 handling in README.html generation.
Browse files Browse the repository at this point in the history
  • Loading branch information
MagerValp committed Dec 1, 2016
1 parent f170c5a commit 10a99e2
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 12 deletions.
2 changes: 1 addition & 1 deletion AutoDMG.xcodeproj/xcshareddata/xcschemes/AutoDMG.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Run Script"
scriptText = "#!/bin/bash&#10;&#10;&#10;exec &gt; &quot;/tmp/$PRODUCT_NAME-archive.log&quot; 2&gt;&amp;1&#10;&#10;declare -r DIST_ID=&quot;Developer ID Application: University of Gothenburg&quot;&#10;&#10;export PATH=&quot;${PATH}:$HOME/Dropbox/bin:$HOME/Dropbox/.gem/bin&quot;&#10;export GEM_HOME=&quot;$HOME/Dropbox/.gem&quot;&#10;&#10;echo &quot;# Environment:&quot;&#10;while read -r v; do&#10;echo &quot; export $v&quot;&#10;done &lt; &lt;(env | sort)&#10;&#10;appdir=&quot;$ARCHIVE_PRODUCTS_PATH/$INSTALL_PATH&quot;&#10;&#10;version=$(/usr/libexec/PlistBuddy -c &quot;Print :CFBundleShortVersionString&quot; &quot;$appdir/$INFOPLIST_PATH&quot;)&#10;if [[ &quot;$version&quot; == *b ]]; then&#10; version=&quot;$version$(/usr/libexec/PlistBuddy -c &quot;Print :CFBundleVersion&quot; &quot;$appdir/$INFOPLIST_PATH&quot;)&quot;&#10;fi&#10;echo &quot;# Archiving $PRODUCT_NAME version $version&quot;&#10;&#10;distdir=&quot;$PROJECT_DIR/Distributions&quot;&#10;releasedir=&quot;$distdir/$PRODUCT_NAME-$version&quot;&#10;dmgpath=&quot;$releasedir.dmg&quot;&#10;&#10;rm -rf &quot;$releasedir&quot; &quot;$dmgpath&quot;&#10;&#10;echo &quot;# Creating $releasedir&quot;&#10;mkdir -p &quot;$releasedir&quot;&#10;open -R &quot;$releasedir&quot;&#10;&#10;echo &quot;# Copying $appdir/$FULL_PRODUCT_NAME&quot;&#10;ditto &quot;$appdir/$FULL_PRODUCT_NAME&quot; &quot;$releasedir/$FULL_PRODUCT_NAME&quot;&#10;&#10;echo &quot;# Signing app as $DIST_ID&quot;&#10;codesign -f -vv -s &quot;$DIST_ID&quot; &quot;$releasedir/$FULL_PRODUCT_NAME&quot; || exit 1&#10;&#10;echo &quot;# Creating $releasedir/$PRODUCT_NAME.html&quot;&#10;kramdown &quot;$PROJECT_DIR/README.markdown&quot; | cat &quot;$PROJECT_DIR/README.css&quot; - | tidy -q -i &gt; &quot;$releasedir/$PRODUCT_NAME.html&quot; 2&gt;/dev/null&#10;&#10;echo &quot;# Creating $dmgpath&quot;&#10;hdiutil create -srcfolder &quot;$releasedir&quot; -ov &quot;$dmgpath&quot;&#10;&#10;open -R &quot;$dmgpath&quot;&#10;&#10;&#10;exit 0&#10;"
scriptText = "#!/bin/bash&#10;&#10;set -o errexit&#10;&#10;&#10;exec &gt; &quot;/tmp/$PRODUCT_NAME-archive.log&quot; 2&gt;&amp;1&#10;&#10;declare -r DIST_ID=&quot;Developer ID Application: University of Gothenburg&quot;&#10;&#10;export PATH=&quot;${PATH}:$HOME/Dropbox/bin:$HOME/Dropbox/.gem/bin&quot;&#10;export GEM_HOME=&quot;$HOME/Dropbox/.gem&quot;&#10;&#10;export LC_ALL=&quot;en_US.UTF-8&quot;&#10;&#10;echo &quot;# Environment:&quot;&#10;while read -r v; do&#10;echo &quot; export $v&quot;&#10;done &lt; &lt;(env | sort)&#10;&#10;appdir=&quot;$ARCHIVE_PRODUCTS_PATH/$INSTALL_PATH&quot;&#10;&#10;version=$(/usr/libexec/PlistBuddy -c &quot;Print :CFBundleShortVersionString&quot; &quot;$appdir/$INFOPLIST_PATH&quot;)&#10;if [[ &quot;$version&quot; == *b ]]; then&#10; version=&quot;$version$(/usr/libexec/PlistBuddy -c &quot;Print :CFBundleVersion&quot; &quot;$appdir/$INFOPLIST_PATH&quot;)&quot;&#10;fi&#10;echo &quot;# Archiving $PRODUCT_NAME version $version&quot;&#10;&#10;distdir=&quot;$PROJECT_DIR/Distributions&quot;&#10;releasedir=&quot;$distdir/$PRODUCT_NAME-$version&quot;&#10;dmgpath=&quot;$releasedir.dmg&quot;&#10;&#10;rm -rf &quot;$releasedir&quot; &quot;$dmgpath&quot;&#10;&#10;echo &quot;# Creating $releasedir&quot;&#10;mkdir -p &quot;$releasedir&quot;&#10;open -R &quot;$releasedir&quot;&#10;&#10;echo &quot;# Copying $appdir/$FULL_PRODUCT_NAME&quot;&#10;ditto &quot;$appdir/$FULL_PRODUCT_NAME&quot; &quot;$releasedir/$FULL_PRODUCT_NAME&quot;&#10;&#10;echo &quot;# Signing app as $DIST_ID&quot;&#10;codesign -f -vv -s &quot;$DIST_ID&quot; &quot;$releasedir/$FULL_PRODUCT_NAME&quot;&#10;&#10;echo &quot;# Creating $releasedir/$PRODUCT_NAME.html&quot;&#10;ruby --external-encoding UTF-8 -S $(which kramdown) --template=&quot;$PROJECT_DIR/README.template&quot; &quot;$PROJECT_DIR/README.markdown&quot; &gt; &quot;$releasedir/$PRODUCT_NAME.html&quot;&#10;&#10;echo &quot;# Creating $dmgpath&quot;&#10;hdiutil create -srcfolder &quot;$releasedir&quot; -ov &quot;$dmgpath&quot;&#10;&#10;open -R &quot;$dmgpath&quot;&#10;&#10;&#10;exit 0&#10;"
shellToInvoke = "/bin/bash">
<EnvironmentBuildable>
<BuildableReference
Expand Down
11 changes: 0 additions & 11 deletions README.css

This file was deleted.

27 changes: 27 additions & 0 deletions README.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>

<html>
<head>
<meta charset="utf-8">

<style type="text/css">

body {
font-family: sans-serif;
}

li {
list-style: disc;
}

</style>

<title>AutoDMG</title>
</head>

<body>

<%= @body %>

</body>
</html>

0 comments on commit 10a99e2

Please sign in to comment.