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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/paths.js +11 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "antigravity-rtl-patcher",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "🌌 Intelligent RTL & Persian/Arabic typography patcher for Antigravity",
5
5
  "main": "src/patcher.js",
6
6
  "bin": {
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
- const home = os.homedir();
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 = [