File: postprocess-web

package info (click to toggle)
xaos 4.3.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 14,528 kB
  • sloc: cpp: 24,154; ansic: 2,936; sh: 303; xml: 146; python: 39; makefile: 3
file content (28 lines) | stat: -rwxr-xr-x 693 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash

# This script sets the document title for the WebAssembly version in xaos.js,
# and it copies the correct qtlogo.svg to the same folder.

set -e

if [ $# != 2 ]; then
 echo "Usage: $0 [source-folder] [build-folder]"
 exit 1
 fi

test "$2/xaos.js" || {
 echo "The file $2/xaos.js is missing."
 exit 2
 }

# This will not work on macOS, FIXME:
sed -i 's/Module\["print"\]/\
 function mymessage(t) {\
  let statustext = "STATUS: ";\
  if (t.startsWith(statustext)) document.title = t.substring(statustext.length);\
  }\
/' "$2/xaos.js"
# For a workaround on macOS, see https://stackoverflow.com/questions/12696125/sed-edit-file-in-place

cp "$1/src/ui/images/qtlogo.svg" "$2"
exit 0