-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall.js
55 lines (49 loc) · 1.21 KB
/
install.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
48
49
50
51
52
53
54
55
// If this fails, run 'npm install && npm run build'
const installdir = "/usr/share/iheartradio-webapp/";
const exec = require('child_process');
// Node likes to have fun and bounce around. THIS MUST COME FIRST.
function createInstalldir() {
exec(
"mkdir " + installdir + " " + installdir + "src/",
(error, stdout, stderr) => {
if (error) throw error;
if (stderr) throw stderr;
}
);
}
function installApp() {
// We do this because this way we also get .so libraries with it
exec(
"cp -r dist/linux-unpacked/* " + installdir,
(error, stdout, stderr) => {
if (error) throw error;
if (stderr) throw stderr;
}
);
}
function linkBinary() {
exec(
"ln -sn " + installdir + "iheartradio /usr/bin/iheartradio",
(error, stdout, stderr) => {
if (error) throw error;
if (stderr) throw stderr;
}
);
}
createInstalldir();
installApp();
linkBinary();
exec(
"cp data/iheartradio.desktop /usr/share/applications/",
(error, stdout, stderr) => {
if (error) throw error;
if (stderr) throw stderr;
}
);
exec(
"cp data/iheartradio.png /usr/share/pixmaps/",
(error, stdout, stderr) => {
if (error) throw error;
if (stderr) throw stderr;
}
);