lenix 1.0.3 → 1.0.5

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/bin/Readme.md CHANGED
@@ -3,8 +3,9 @@
3
3
  Auto-configure Lua to use `./lua_modules` (like `node_modules`).
4
4
 
5
5
  ### Install
6
+ - MAC
6
7
  ```bash
7
- npx lenix-lua-modules
8
+ npx mac-lua-modules
8
9
  ```
9
10
 
10
11
  ### Usage
@@ -19,5 +20,5 @@ print(inspect({name = "Lenix"}))
19
20
 
20
21
  ### What it does
21
22
 
22
- Adds environment variables to your shell config (`~/.zshrc` or `~/.bashrc`) to automatically change your Lua modules configurations to `./lua_modules` instead of hidden nested directories.
23
+ Adds environment variables to your shell config (for mac users: `~/.zshrc` or `~/.bashrc`) to automatically change your Lua modules configurations to `./lua_modules` instead of hidden nested directories.
23
24
  ```
@@ -1,9 +1,12 @@
1
1
  #!/bin/bash
2
2
 
3
- SHELL_CONFIG="${HOME}/.zshrc"
4
-
5
- if [ -f "${HOME}/.bashrc" ]; then
3
+ if [ -n "$ZSH_VERSION" ]; then
4
+ SHELL_CONFIG="${HOME}/.zshrc"
5
+ elif [ -n "$BASH_VERSION" ]; then
6
6
  SHELL_CONFIG="${HOME}/.bashrc"
7
+ PROFILE_CONFIG="${HOME}/.bash_profile"
8
+ else
9
+ SHELL_CONFIG="${HOME}/.profile"
7
10
  fi
8
11
 
9
12
  touch "$SHELL_CONFIG"
@@ -28,7 +31,7 @@ if [[ ! $REPLY =~ ^[Yy]$ ]]; then
28
31
  fi
29
32
 
30
33
  if grep -q "# Lua local modules setup" "$SHELL_CONFIG"; then
31
- echo "⚠️ Already installed in $SHELL_CONFIG"
34
+ echo " Already installed in $SHELL_CONFIG"
32
35
  echo "Installation aborted."
33
36
  exit 0
34
37
  fi
@@ -38,15 +41,26 @@ echo '# Lua local modules setup' >> "$SHELL_CONFIG"
38
41
  echo 'eval $(luarocks path --bin)' >> "$SHELL_CONFIG"
39
42
  echo 'export LUA_PATH="./lua_modules/share/lua/5.4/?.lua;./lua_modules/share/lua/5.4/?/init.lua;;"' >> "$SHELL_CONFIG"
40
43
  echo 'export LUA_CPATH="./lua_modules/lib/lua/5.4/?.so;;"' >> "$SHELL_CONFIG"
44
+ echo '# Lua local modules end.' >> "$SHELL_CONFIG"
45
+
46
+ if [ -n "$BASH_VERSION" ] && [ -n "$PROFILE_CONFIG" ]; then
47
+ touch "$PROFILE_CONFIG"
48
+ if ! grep -q "source.*bashrc" "$PROFILE_CONFIG"; then
49
+ echo '' >> "$PROFILE_CONFIG"
50
+ echo '# Source .bashrc' >> "$PROFILE_CONFIG"
51
+ echo 'if [ -f ~/.bashrc ]; then source ~/.bashrc; fi' >> "$PROFILE_CONFIG"
52
+ fi
53
+ fi
41
54
 
42
55
  source "$SHELL_CONFIG" 2>/dev/null || true
43
56
 
44
57
  echo ""
45
- echo "✓ Setup complete!"
46
- echo "✓ Added 4 lines to: $SHELL_CONFIG"
58
+ echo "Setup complete!"
59
+ echo "Added to: $SHELL_CONFIG"
47
60
  echo ""
48
- echo "📦 Usage:"
61
+ echo "Usage:"
49
62
  echo " luarocks install --tree ./lua_modules <package>"
50
63
  echo ""
51
- echo "To undo, remove lines containing '# Lua local modules setup' from $SHELL_CONFIG"
52
- echo "Restart your terminal or run: source $SHELL_CONFIG"
64
+ echo " IMPORTANT: Restart your terminal for changes to take effect"
65
+ echo ""
66
+ echo "To undo, remove lines containing '# Lua local modules setup' from $SHELL_CONFIG"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lenix",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "",
5
5
  "author": "Lenix",
6
6
  "license": "GPL-3.0",
@@ -23,13 +23,13 @@
23
23
  "dist",
24
24
  "bin"
25
25
  ],
26
+ "scripts": {
27
+ "build": "tsc -p src/fxmanifest/tsconfig.json"
28
+ },
26
29
  "devDependencies": {
27
30
  "typescript": "^5.3.3"
28
31
  },
29
32
  "dependencies": {
30
33
  "@types/node": "^20.7.1"
31
- },
32
- "scripts": {
33
- "build": "tsc -p src/fxmanifest/tsconfig.json"
34
34
  }
35
- }
35
+ }