lenix 1.0.3 → 1.0.4

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,11 +1,17 @@
1
1
  #!/bin/bash
2
2
 
3
- SHELL_CONFIG="${HOME}/.zshrc"
3
+ # Detect actual shell
4
+ SHELL_CONFIG="${HOME}/.bashrc"
4
5
 
5
- if [ -f "${HOME}/.bashrc" ]; then
6
+ if [[ "$SHELL" == *"zsh"* ]]; then
7
+ SHELL_CONFIG="${HOME}/.zshrc"
8
+ elif [[ "$SHELL" == *"bash"* ]]; then
9
+ # Bash needs .bash_profile to source .bashrc
6
10
  SHELL_CONFIG="${HOME}/.bashrc"
11
+ PROFILE_CONFIG="${HOME}/.bash_profile"
7
12
  fi
8
13
 
14
+ # Create shell config if it doesn't exist
9
15
  touch "$SHELL_CONFIG"
10
16
 
11
17
  echo "===================================="
@@ -38,15 +44,26 @@ echo '# Lua local modules setup' >> "$SHELL_CONFIG"
38
44
  echo 'eval $(luarocks path --bin)' >> "$SHELL_CONFIG"
39
45
  echo 'export LUA_PATH="./lua_modules/share/lua/5.4/?.lua;./lua_modules/share/lua/5.4/?/init.lua;;"' >> "$SHELL_CONFIG"
40
46
  echo 'export LUA_CPATH="./lua_modules/lib/lua/5.4/?.so;;"' >> "$SHELL_CONFIG"
47
+ echo '# Lua local modules end.' >> "$SHELL_CONFIG"
48
+
49
+ # For bash, ensure .bash_profile sources .bashrc
50
+ if [[ "$SHELL" == *"bash"* ]] && [ -n "$PROFILE_CONFIG" ]; then
51
+ if [ ! -f "$PROFILE_CONFIG" ] || ! grep -q "source.*bashrc" "$PROFILE_CONFIG"; then
52
+ echo '' >> "$PROFILE_CONFIG"
53
+ echo '# Source .bashrc' >> "$PROFILE_CONFIG"
54
+ echo 'if [ -f ~/.bashrc ]; then source ~/.bashrc; fi' >> "$PROFILE_CONFIG"
55
+ fi
56
+ fi
41
57
 
42
58
  source "$SHELL_CONFIG" 2>/dev/null || true
43
59
 
44
60
  echo ""
45
61
  echo "✓ Setup complete!"
46
- echo "✓ Added 4 lines to: $SHELL_CONFIG"
62
+ echo "✓ Added to: $SHELL_CONFIG"
47
63
  echo ""
48
64
  echo "📦 Usage:"
49
65
  echo " luarocks install --tree ./lua_modules <package>"
50
66
  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"
67
+ echo "⚠️ IMPORTANT: Restart your terminal for changes to take effect"
68
+ echo ""
69
+ 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.4",
4
4
  "description": "",
5
5
  "author": "Lenix",
6
6
  "license": "GPL-3.0",