antigravity-rtl-patcher 2.1.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/paths.js +11 -1
package/package.json
CHANGED
package/src/paths.js
CHANGED
|
@@ -7,7 +7,17 @@ const os = require('os');
|
|
|
7
7
|
* Both the IDE (unpacked) and the standalone app (asar) are supported.
|
|
8
8
|
*/
|
|
9
9
|
function getSearchPaths() {
|
|
10
|
-
|
|
10
|
+
// When running with sudo, os.homedir() returns /root.
|
|
11
|
+
// Use SUDO_USER to resolve the actual user's home directory.
|
|
12
|
+
var home = os.homedir();
|
|
13
|
+
if (process.env.SUDO_USER) {
|
|
14
|
+
const sudoHome = process.platform === 'darwin'
|
|
15
|
+
? path.join('/Users', process.env.SUDO_USER)
|
|
16
|
+
: path.join('/home', process.env.SUDO_USER);
|
|
17
|
+
if (fs.existsSync(sudoHome)) {
|
|
18
|
+
home = sudoHome;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
11
21
|
const platform = os.platform();
|
|
12
22
|
|
|
13
23
|
const common = [
|