-
Notifications
You must be signed in to change notification settings - Fork 1
/
update-theia.php
32 lines (25 loc) · 954 Bytes
/
update-theia.php
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
<?php
require("lib/config.php");
// UPDATING Theia INSTANCE IN theia DIR
`rm -fr $conf_base_path/theia-upstream`;
`mkdir $conf_base_path/theia-upstream`;
`chmod 777 $conf_base_path/theia-upstream`;
// Install Theia
`chmod 755 $conf_base_path/install-theia-c9.sh`;
$return = 0;
do {
system("su $conf_c9_user -c \"cd $conf_base_path/theia-upstream; ../install-theia-c9.sh\"", $return);
} while ($return != 0);
`chmod 644 $conf_base_path/install-theia-c9.sh`;
// Fix permisions
`chmod a+r $conf_base_path/theia-upstream -R`;
`chmod 777 $conf_shared_path/.cache -R`;
`chmod 777 $conf_shared_path/.config -R`;
`chmod 777 $conf_shared_path/.npm -R`;
`chmod 777 $conf_shared_path/.nvm -R`;
`chmod 777 $conf_shared_path/.yarn -R`;
`chmod 644 $conf_shared_path/.yarnrc`;
// New theia becomes default theia
`rm -fr $conf_base_path/theia-old`;
`mv $conf_base_path/theia $conf_base_path/theia-old`;
`mv $conf_base_path/theia-upstream $conf_base_path/theia`;