Project

General

Profile

Download (834 Bytes) Statistics
| Branch: | Tag: | Revision:

haketilo / write_exports_init.sh @ 3a90084e

1
#!/bin/sh
2

    
3
# This file is part of Haketilo
4
#
5
# Copyright (C) 2021, Wojtek Kosior
6
#
7
# This program is free software: you can redistribute it and/or modify
8
# it under the terms of the CC0 1.0 Universal License as published by
9
# the Creative Commons Corporation.
10
#
11
# This program is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
# CC0 1.0 Universal License for more details.
15

    
16
set -e
17

    
18
BROWSER="$1"
19
BUILDDIR="$2"
20
SETTINGS="$3"
21

    
22
if [ "chromium" = "$BROWSER" ]; then
23
    cp CHROMIUM_exports_init.js "$BUILDDIR"/exports_init.js
24
else
25
    cp MOZILLA_exports_init.js "$BUILDDIR"/exports_init.js
26
fi
27

    
28
printf 'window.haketilo_exports.initial_data = %s;\n' "$(cat "$SETTINGS")" \
29
       >> "$BUILDDIR"/exports_init.js
(17-17/18)