This repository has been archived by the owner on May 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
pre_build.js
47 lines (41 loc) · 1.57 KB
/
pre_build.js
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//
// UI for IVPN Client Desktop
// https://github.com/ivpn/desktop-app-ui2
//
// Created by Stelnykovych Alexandr.
// Copyright (c) 2020 Privatus Limited.
//
// This file is part of the UI for IVPN Client Desktop.
//
// The UI for IVPN Client Desktop is free software: you can redistribute it and/or
// modify it under the terms of the GNU General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any later version.
//
// The UI for IVPN Client Desktop is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License
// along with the UI for IVPN Client Desktop. If not, see <https://www.gnu.org/licenses/>.
//
const os = require("os");
var styleLoaderFile = __dirname + "/src/main_style.js";
var styleLoaderFilePlatform =
__dirname + "/src/main_style_" + os.platform() + ".js";
console.log("Using style loader script: " + styleLoaderFilePlatform);
var fs = require("fs");
if (fs.existsSync(styleLoaderFilePlatform)) {
fs.copyFileSync(styleLoaderFilePlatform, styleLoaderFile);
} else {
var mainStyleFileNotExists =
" *** ERROR: FILE NOT EXISTS: *** '" +
styleLoaderFilePlatform +
"'. Is [" +
os.platform() +
"] platform supported? ";
console.error("");
console.error(mainStyleFileNotExists);
console.error();
throw mainStyleFileNotExists;
}