lenix 1.0.2 → 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
|
|
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,19 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# Detect actual shell
|
|
4
|
+
SHELL_CONFIG="${HOME}/.bashrc"
|
|
4
5
|
|
|
5
|
-
if [
|
|
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
|
|
15
|
+
touch "$SHELL_CONFIG"
|
|
16
|
+
|
|
9
17
|
echo "===================================="
|
|
10
18
|
echo "Lua Modules Setup"
|
|
11
19
|
echo "===================================="
|
|
@@ -36,15 +44,26 @@ echo '# Lua local modules setup' >> "$SHELL_CONFIG"
|
|
|
36
44
|
echo 'eval $(luarocks path --bin)' >> "$SHELL_CONFIG"
|
|
37
45
|
echo 'export LUA_PATH="./lua_modules/share/lua/5.4/?.lua;./lua_modules/share/lua/5.4/?/init.lua;;"' >> "$SHELL_CONFIG"
|
|
38
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
|
|
39
57
|
|
|
40
58
|
source "$SHELL_CONFIG" 2>/dev/null || true
|
|
41
59
|
|
|
42
60
|
echo ""
|
|
43
61
|
echo "✓ Setup complete!"
|
|
44
|
-
echo "✓ Added
|
|
62
|
+
echo "✓ Added to: $SHELL_CONFIG"
|
|
45
63
|
echo ""
|
|
46
64
|
echo "📦 Usage:"
|
|
47
65
|
echo " luarocks install --tree ./lua_modules <package>"
|
|
48
66
|
echo ""
|
|
49
|
-
echo "
|
|
50
|
-
echo "
|
|
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
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Lenix",
|
|
6
6
|
"license": "GPL-3.0",
|
|
@@ -17,19 +17,19 @@
|
|
|
17
17
|
"main": "./dist/index.js",
|
|
18
18
|
"types": "./dist/index.d.ts",
|
|
19
19
|
"bin": {
|
|
20
|
-
"
|
|
20
|
+
"mac-lua-modules": "bin/mac-lua_modules.sh"
|
|
21
21
|
},
|
|
22
22
|
"files": [
|
|
23
23
|
"dist",
|
|
24
24
|
"bin"
|
|
25
25
|
],
|
|
26
|
-
"scripts": {
|
|
27
|
-
"build": "tsc -p src/fxmanifest/tsconfig.json"
|
|
28
|
-
},
|
|
29
26
|
"devDependencies": {
|
|
30
27
|
"typescript": "^5.3.3"
|
|
31
28
|
},
|
|
32
29
|
"dependencies": {
|
|
33
30
|
"@types/node": "^20.7.1"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsc -p src/fxmanifest/tsconfig.json"
|
|
34
34
|
}
|
|
35
|
-
}
|
|
35
|
+
}
|