mirror of https://github.com/Hilbis/Hilbish
Compare commits
No commits in common. "174d67c9e1848a9839fd33ff850df4f08a4fbc43" and "b008d48c60bc6c810762cecd9c9d50824d14bcaa" have entirely different histories.
174d67c9e1
...
b008d48c60
33
CHANGELOG.md
33
CHANGELOG.md
|
@ -2,18 +2,8 @@
|
||||||
|
|
||||||
This is the changelog for the Hilbish shell made in Go and Lua.
|
This is the changelog for the Hilbish shell made in Go and Lua.
|
||||||
|
|
||||||
## [0.6.1] - 2021-10-21
|
|
||||||
### Fixed
|
|
||||||
- Require paths now use the `dataDir` variable so there is no need to change it anymore unless you want to add more paths
|
|
||||||
- Remove double slash in XDG data require paths
|
|
||||||
- Ctrl+C is handled properly when not interactive and won't result in a panic anymore
|
|
||||||
- Commanders are handled by the sh interpreter library only now, so they work with sh syntax
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
- Error messages from `fs` functions now include the path provided
|
|
||||||
|
|
||||||
## [0.6.0] - 2021-10-17
|
## [0.6.0] - 2021-10-17
|
||||||
### Added
|
## Added
|
||||||
- Hilbish will expand `~` in the preloadPath and samplePathConf variables. These are for compile time.
|
- Hilbish will expand `~` in the preloadPath and samplePathConf variables. These are for compile time.
|
||||||
- On Windows, the hostname in `%u` has been removed.
|
- On Windows, the hostname in `%u` has been removed.
|
||||||
- Made it easier to compile on Windows by adding Windows-tailored vars and paths.
|
- Made it easier to compile on Windows by adding Windows-tailored vars and paths.
|
||||||
|
@ -34,13 +24,13 @@ This is the changelog for the Hilbish shell made in Go and Lua.
|
||||||
- The [Succulent](https://github.com/Rosettea/Succulent) library has been added. This includes more utility functions and expansions to the Lua standard library itself.
|
- The [Succulent](https://github.com/Rosettea/Succulent) library has been added. This includes more utility functions and expansions to the Lua standard library itself.
|
||||||
- The command string is now passed to the `command.exit` hook
|
- The command string is now passed to the `command.exit` hook
|
||||||
|
|
||||||
### Changed
|
# Changed
|
||||||
- Hilbish won't print an extra newline at exit with ctrl + d
|
- Hilbish won't print an extra newline at exit with ctrl + d
|
||||||
- `command.exit` with 0 exit code will now be thrown if input is nothing
|
- `command.exit` with 0 exit code will now be thrown if input is nothing
|
||||||
- **Breaking Change:** `fs.stat` has been made better. It returns a proper table instead of userdata, and has fields instead of functions
|
- **Breaking Change:** `fs.stat` has been made better. It returns a proper table instead of userdata, and has fields instead of functions
|
||||||
- It includes `name`, `mode` as a octal representation in a string, `isDir`, and `size`
|
- It includes `name`, `mode` as a octal representation in a string, `isDir`, and `size`
|
||||||
|
|
||||||
### Fixed
|
# Fixed
|
||||||
- `timeout()` is now blocking
|
- `timeout()` is now blocking
|
||||||
- Directories with spaces in them can now be `cd`'d to
|
- Directories with spaces in them can now be `cd`'d to
|
||||||
- An alias with the same name as the command will now not cause a freeze (#73)
|
- An alias with the same name as the command will now not cause a freeze (#73)
|
||||||
|
@ -50,15 +40,15 @@ This is the changelog for the Hilbish shell made in Go and Lua.
|
||||||
|
|
||||||
## [0.5.1] - 2021-06-16
|
## [0.5.1] - 2021-06-16
|
||||||
|
|
||||||
### Added
|
## Added
|
||||||
|
|
||||||
- Add `~/.config/hilbish` as a require path
|
- Add `~/.config/hilbish` as a require path
|
||||||
|
|
||||||
### Changed
|
## Changed
|
||||||
|
|
||||||
- `cd` hook is only thrown after directory has actually changed
|
- `cd` hook is only thrown after directory has actually changed
|
||||||
|
|
||||||
### Fixed
|
## Fixed
|
||||||
|
|
||||||
- Handle error in commander properly, preventing a panic from Lua
|
- Handle error in commander properly, preventing a panic from Lua
|
||||||
|
|
||||||
|
@ -66,7 +56,7 @@ This is the changelog for the Hilbish shell made in Go and Lua.
|
||||||
|
|
||||||
An absolutely massive release. Probably the biggest yet, includes a bunch of fixes and new features and convenient additions to the Lua API.
|
An absolutely massive release. Probably the biggest yet, includes a bunch of fixes and new features and convenient additions to the Lua API.
|
||||||
|
|
||||||
### Added
|
## Added
|
||||||
|
|
||||||
- `-n` flag, which checks Lua for syntax errors without running it
|
- `-n` flag, which checks Lua for syntax errors without running it
|
||||||
- `exec(command)` function, acts like the `exec` builtin in sh
|
- `exec(command)` function, acts like the `exec` builtin in sh
|
||||||
|
@ -93,7 +83,7 @@ When `false` is run, it will have the exit code of `1`, this is shorter/easier t
|
||||||
- `hilbish.home` is a crossplatform Lua alternative to get the home directory easily.
|
- `hilbish.home` is a crossplatform Lua alternative to get the home directory easily.
|
||||||
- `commander.deregister(cmdName)` de-registers any command defined with commander.
|
- `commander.deregister(cmdName)` de-registers any command defined with commander.
|
||||||
|
|
||||||
### Changed
|
## Changed
|
||||||
|
|
||||||
- **Breaking Change**: Move `_user` and `_ver` to a global `hilbish` table
|
- **Breaking Change**: Move `_user` and `_ver` to a global `hilbish` table
|
||||||
- Accessing username and Hilbish version is now done with `hilbish.user` and `hilbish.ver`
|
- Accessing username and Hilbish version is now done with `hilbish.user` and `hilbish.ver`
|
||||||
|
@ -110,7 +100,7 @@ When `false` is run, it will have the exit code of `1`, this is shorter/easier t
|
||||||
- Add input to history before alias expansion. Basically, this adds the actual alias to history instead of the aliased command.
|
- Add input to history before alias expansion. Basically, this adds the actual alias to history instead of the aliased command.
|
||||||
- Global preload path, require paths, default config directory and sample config directory can now be changed at compile time to help support other systems.
|
- Global preload path, require paths, default config directory and sample config directory can now be changed at compile time to help support other systems.
|
||||||
|
|
||||||
### Fixed
|
## Fixed
|
||||||
|
|
||||||
- `cd` now exits with code `1` instead of the error code if it occurs
|
- `cd` now exits with code `1` instead of the error code if it occurs
|
||||||
- Don't append directory to $PATH with `appendPath` if its already there
|
- Don't append directory to $PATH with `appendPath` if its already there
|
||||||
|
@ -121,7 +111,7 @@ When `false` is run, it will have the exit code of `1`, this is shorter/easier t
|
||||||
|
|
||||||
## [0.4.0] - 2021-05-01
|
## [0.4.0] - 2021-05-01
|
||||||
|
|
||||||
### Added
|
## Added
|
||||||
- Ctrl C in the prompt now cancels/clear input (I've needed this for so long also)
|
- Ctrl C in the prompt now cancels/clear input (I've needed this for so long also)
|
||||||
- Made Hilbish act like a login shell on login
|
- Made Hilbish act like a login shell on login
|
||||||
- If Hilbish is the login shell, or the `-l`/`--login` flags are used, Hilbish will use an additional `~/.hprofile.lua` file, you can use this to set environment variables once on login
|
- If Hilbish is the login shell, or the `-l`/`--login` flags are used, Hilbish will use an additional `~/.hprofile.lua` file, you can use this to set environment variables once on login
|
||||||
|
@ -135,7 +125,7 @@ When `false` is run, it will have the exit code of `1`, this is shorter/easier t
|
||||||
- `string.split(str, delimiter)`
|
- `string.split(str, delimiter)`
|
||||||
- Added a `_user` variable to easily get current user's name
|
- Added a `_user` variable to easily get current user's name
|
||||||
|
|
||||||
### Changed
|
## Changed
|
||||||
|
|
||||||
- **BREAKING Change**: [Lunacolors](https://github.com/Hilbis/Lunacolors) has replaced ansikit for formatting colors, which means the format function has been removed from ansikit and moved to Lunacolors.
|
- **BREAKING Change**: [Lunacolors](https://github.com/Hilbis/Lunacolors) has replaced ansikit for formatting colors, which means the format function has been removed from ansikit and moved to Lunacolors.
|
||||||
- Users must replace ansikit with `lunacolors` in their config files
|
- Users must replace ansikit with `lunacolors` in their config files
|
||||||
|
@ -249,7 +239,6 @@ This input for example will prompt for more input to complete:
|
||||||
|
|
||||||
First "stable" release of Hilbish.
|
First "stable" release of Hilbish.
|
||||||
|
|
||||||
[0.6.1]: https://github.com/Rosettea/Hilbish/compare/v0.6.0...v0.6.1
|
|
||||||
[0.6.0]: https://github.com/Rosettea/Hilbish/compare/v0.5.1...v0.6.0
|
[0.6.0]: https://github.com/Rosettea/Hilbish/compare/v0.5.1...v0.6.0
|
||||||
[0.5.1]: https://github.com/Rosettea/Hilbish/compare/v0.5.0...v0.5.1
|
[0.5.1]: https://github.com/Rosettea/Hilbish/compare/v0.5.0...v0.5.1
|
||||||
[0.5.0]: https://github.com/Rosettea/Hilbish/compare/v0.4.0...v0.5.0
|
[0.5.0]: https://github.com/Rosettea/Hilbish/compare/v0.4.0...v0.5.0
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<img src="./assets/hilbish-flower.png" width=128><br>
|
<img src="./assets/hilbish-flower.png" width=128><br>
|
||||||
<img src="./assets/hilbish-text.png" width=256><br><br>
|
<img src="./assets/hilbish-text.png" width=256>
|
||||||
|
<h1></h1>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
🌺 The flower shell. A comfy and nice little shell for Lua users and fans!
|
🌺 The flower shell. A comfy and nice little shell for Lua users and fans!
|
||||||
</blockquote><br>
|
</blockquote>
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/m/Rosettea/Hilbish?style=flat-square">
|
<img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/m/Rosettea/Hilbish?style=flat-square">
|
||||||
<img alt="GitHub commits since latest release (by date)" src="https://img.shields.io/github/commits-since/Rosettea/Hilbish/latest?style=flat-square">
|
<img alt="GitHub commits since latest release (by date)" src="https://img.shields.io/github/commits-since/Rosettea/Hilbish/latest?style=flat-square">
|
||||||
|
|
5
go.mod
5
go.mod
|
@ -9,9 +9,8 @@ require (
|
||||||
github.com/mattn/go-runewidth v0.0.13 // indirect
|
github.com/mattn/go-runewidth v0.0.13 // indirect
|
||||||
github.com/pborman/getopt v1.1.0
|
github.com/pborman/getopt v1.1.0
|
||||||
github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9
|
github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9
|
||||||
golang.org/x/term v0.0.0-20210916214954-140adaaadfaf
|
golang.org/x/sys v0.0.0-20210603125802-9665404d3644 // indirect
|
||||||
|
golang.org/x/term v0.0.0-20210503060354-a79de5458b56
|
||||||
layeh.com/gopher-luar v1.0.8
|
layeh.com/gopher-luar v1.0.8
|
||||||
mvdan.cc/sh/v3 v3.3.0
|
mvdan.cc/sh/v3 v3.3.0
|
||||||
)
|
)
|
||||||
|
|
||||||
replace mvdan.cc/sh/v3 => github.com/Rosettea/sh/v3 v3.4.0-0.dev.0.20211022004519-f67a49cb50f5
|
|
||||||
|
|
14
go.sum
14
go.sum
|
@ -1,9 +1,5 @@
|
||||||
github.com/Rosettea/Hilbiline v0.0.0-20210603231612-80054dac3650 h1:nzFJUdJU8UJ1DA8mSQp4eoBtQyOJyecekVWusjfQsqE=
|
github.com/Rosettea/Hilbiline v0.0.0-20210603231612-80054dac3650 h1:nzFJUdJU8UJ1DA8mSQp4eoBtQyOJyecekVWusjfQsqE=
|
||||||
github.com/Rosettea/Hilbiline v0.0.0-20210603231612-80054dac3650/go.mod h1:/FFZ4cgR6TXXYaskRUxyLIYdfG0PS4BPtWjWRQms754=
|
github.com/Rosettea/Hilbiline v0.0.0-20210603231612-80054dac3650/go.mod h1:/FFZ4cgR6TXXYaskRUxyLIYdfG0PS4BPtWjWRQms754=
|
||||||
github.com/Rosettea/sh/v3 v3.3.0 h1:0/xmOfzpy46gB1I2oPj8QwdYvyJzpdF5STcgNPRQHcI=
|
|
||||||
github.com/Rosettea/sh/v3 v3.3.0/go.mod h1:dh3avhLDhJJ/MJKzbak6FYn+DJKUWk7Fb6Dh5mGdv6Y=
|
|
||||||
github.com/Rosettea/sh/v3 v3.4.0-0.dev.0.20211022004519-f67a49cb50f5 h1:ygwVRX8gf5MHA0VzSgOdscCEoAJLjM8joEotfQPgAd0=
|
|
||||||
github.com/Rosettea/sh/v3 v3.4.0-0.dev.0.20211022004519-f67a49cb50f5/go.mod h1:R09vh/04ILvP2Gj8/Z9Jd0Dh0ZIvaucowMEs6abQpWs=
|
|
||||||
github.com/bobappleyard/readline v0.0.0-20150707195538-7e300e02d38e h1:4G8AYOOwZdDWOiJR6D6JXaFmj5BDS7c5D5PyqsG/+Hg=
|
github.com/bobappleyard/readline v0.0.0-20150707195538-7e300e02d38e h1:4G8AYOOwZdDWOiJR6D6JXaFmj5BDS7c5D5PyqsG/+Hg=
|
||||||
github.com/bobappleyard/readline v0.0.0-20150707195538-7e300e02d38e/go.mod h1:fmqtV+Wqx0uFYLN1F4VhjZdtT56Dr8c3yA7nALFsw/Q=
|
github.com/bobappleyard/readline v0.0.0-20150707195538-7e300e02d38e/go.mod h1:fmqtV+Wqx0uFYLN1F4VhjZdtT56Dr8c3yA7nALFsw/Q=
|
||||||
github.com/chuckpreslar/emission v0.0.0-20170206194824-a7ddd980baf9 h1:xz6Nv3zcwO2Lila35hcb0QloCQsc38Al13RNEzWRpX4=
|
github.com/chuckpreslar/emission v0.0.0-20170206194824-a7ddd980baf9 h1:xz6Nv3zcwO2Lila35hcb0QloCQsc38Al13RNEzWRpX4=
|
||||||
|
@ -14,13 +10,10 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn
|
||||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||||
github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw=
|
github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw=
|
||||||
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||||
github.com/creack/pty v1.1.15/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
|
|
||||||
github.com/google/renameio v1.0.1-0.20210406141108-81588dbe0453/go.mod h1:t/HQoYBZSsWSNK35C6CO/TpPLDVWvxOHboWUAweKUpk=
|
github.com/google/renameio v1.0.1-0.20210406141108-81588dbe0453/go.mod h1:t/HQoYBZSsWSNK35C6CO/TpPLDVWvxOHboWUAweKUpk=
|
||||||
github.com/google/renameio v1.0.1/go.mod h1:t/HQoYBZSsWSNK35C6CO/TpPLDVWvxOHboWUAweKUpk=
|
|
||||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||||
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
|
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
|
||||||
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||||
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
|
|
||||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||||
|
@ -34,9 +27,7 @@ github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsK
|
||||||
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||||
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
|
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
|
||||||
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||||
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
|
|
||||||
github.com/rogpeppe/go-internal v1.7.0/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
|
github.com/rogpeppe/go-internal v1.7.0/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
|
||||||
github.com/rogpeppe/go-internal v1.8.1-0.20210923151022-86f73c517451/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o=
|
|
||||||
github.com/yuin/gopher-lua v0.0.0-20190206043414-8bfc7677f583/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ=
|
github.com/yuin/gopher-lua v0.0.0-20190206043414-8bfc7677f583/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ=
|
||||||
github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9 h1:k/gmLsJDWwWqbLCur2yWnJzwQEKRcAHXo6seXGuSwWw=
|
github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9 h1:k/gmLsJDWwWqbLCur2yWnJzwQEKRcAHXo6seXGuSwWw=
|
||||||
github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9/go.mod h1:E1AXubJBdNmFERAOucpDIxNzeGfLzg0mYh+UfMWdChA=
|
github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9/go.mod h1:E1AXubJBdNmFERAOucpDIxNzeGfLzg0mYh+UfMWdChA=
|
||||||
|
@ -48,14 +39,9 @@ golang.org/x/sys v0.0.0-20210414055047-fe65e336abe0/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||||
golang.org/x/sys v0.0.0-20210503080704-8803ae5d1324/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20210503080704-8803ae5d1324/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20210603125802-9665404d3644 h1:CA1DEQ4NdKphKeL70tvsWNdT5oFh1lOjihRcEDROi0I=
|
golang.org/x/sys v0.0.0-20210603125802-9665404d3644 h1:CA1DEQ4NdKphKeL70tvsWNdT5oFh1lOjihRcEDROi0I=
|
||||||
golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|
||||||
golang.org/x/sys v0.0.0-20210925032602-92d5a993a665 h1:QOQNt6vCjMpXE7JSK5VvAzJC1byuN3FgTNSBwf+CJgI=
|
|
||||||
golang.org/x/sys v0.0.0-20210925032602-92d5a993a665/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|
||||||
golang.org/x/term v0.0.0-20210406210042-72f3dc4e9b72/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
golang.org/x/term v0.0.0-20210406210042-72f3dc4e9b72/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||||
golang.org/x/term v0.0.0-20210503060354-a79de5458b56 h1:b8jxX3zqjpqb2LklXPzKSGJhzyxCOZSz8ncv8Nv+y7w=
|
golang.org/x/term v0.0.0-20210503060354-a79de5458b56 h1:b8jxX3zqjpqb2LklXPzKSGJhzyxCOZSz8ncv8Nv+y7w=
|
||||||
golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY=
|
golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY=
|
||||||
golang.org/x/term v0.0.0-20210916214954-140adaaadfaf h1:Ihq/mm/suC88gF8WFcVwk+OV6Tq+wyA1O0E5UEvDglI=
|
|
||||||
golang.org/x/term v0.0.0-20210916214954-140adaaadfaf/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
|
||||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
||||||
layeh.com/gopher-luar v1.0.8 h1:Uqws1Z6T0vK6pZ7ehNNurLLSFcz7+E0EOHVM4FNiMQs=
|
layeh.com/gopher-luar v1.0.8 h1:Uqws1Z6T0vK6pZ7ehNNurLLSFcz7+E0EOHVM4FNiMQs=
|
||||||
|
|
|
@ -37,7 +37,7 @@ func fcd(L *lua.LState) int {
|
||||||
err := os.Chdir(strings.TrimSpace(path))
|
err := os.Chdir(strings.TrimSpace(path))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
e := err.(*os.PathError).Err.Error()
|
e := err.(*os.PathError).Err.Error()
|
||||||
L.RaiseError(e + ": " + path)
|
L.RaiseError(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
@ -57,7 +57,7 @@ func fmkdir(L *lua.LState) int {
|
||||||
err = os.Mkdir(path, 0744)
|
err = os.Mkdir(path, 0744)
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
L.RaiseError(err.Error() + ": " + path)
|
L.RaiseError(err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
@ -70,7 +70,7 @@ func fstat(L *lua.LState) int {
|
||||||
|
|
||||||
pathinfo, err := os.Stat(path)
|
pathinfo, err := os.Stat(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
L.RaiseError(err.Error() + ": " + path)
|
L.RaiseError(err.Error())
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
statTbl := L.NewTable()
|
statTbl := L.NewTable()
|
||||||
|
@ -91,7 +91,7 @@ func freaddir(L *lua.LState) int {
|
||||||
|
|
||||||
dirEntries, err := os.ReadDir(dir)
|
dirEntries, err := os.ReadDir(dir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
L.RaiseError(err.Error() + ": " + dir)
|
L.RaiseError(err.Error())
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
for _, entry := range dirEntries {
|
for _, entry := range dirEntries {
|
||||||
|
|
29
shell.go
29
shell.go
|
@ -53,6 +53,35 @@ func RunInput(input string) {
|
||||||
cmdFinish(0, cmdString)
|
cmdFinish(0, cmdString)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if commands[cmdArgs[0]] != nil {
|
||||||
|
luacmdArgs := l.NewTable()
|
||||||
|
for _, str := range cmdArgs[1:] {
|
||||||
|
luacmdArgs.Append(lua.LString(str))
|
||||||
|
}
|
||||||
|
|
||||||
|
err := l.CallByParam(lua.P{
|
||||||
|
Fn: commands[cmdArgs[0]],
|
||||||
|
NRet: 1,
|
||||||
|
Protect: true,
|
||||||
|
}, luacmdArgs)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintln(os.Stderr,
|
||||||
|
"Error in command:\n\n" + err.Error())
|
||||||
|
cmdFinish(1, cmdString)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
luaexitcode := l.Get(-1)
|
||||||
|
var exitcode uint8 = 0
|
||||||
|
|
||||||
|
l.Pop(1)
|
||||||
|
|
||||||
|
if code, ok := luaexitcode.(lua.LNumber); luaexitcode != lua.LNil && ok {
|
||||||
|
exitcode = uint8(code)
|
||||||
|
}
|
||||||
|
|
||||||
|
cmdFinish(exitcode, cmdString)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Last option: use sh interpreter
|
// Last option: use sh interpreter
|
||||||
err = execCommand(cmdString)
|
err = execCommand(cmdString)
|
||||||
|
|
2
vars.go
2
vars.go
|
@ -2,7 +2,7 @@ package main
|
||||||
|
|
||||||
// String vars that are free to be changed at compile time
|
// String vars that are free to be changed at compile time
|
||||||
var (
|
var (
|
||||||
version = "v0.6.1"
|
version = "v0.6.0"
|
||||||
defaultConfDir = "" // ~ will be substituted for home, path for user's default config
|
defaultConfDir = "" // ~ will be substituted for home, path for user's default config
|
||||||
defaultHistDir = ""
|
defaultHistDir = ""
|
||||||
commonRequirePaths = "';./libs/?/init.lua;./?/init.lua;./?/?.lua'"
|
commonRequirePaths = "';./libs/?/init.lua;./?/init.lua;./?/?.lua'"
|
||||||
|
|
Loading…
Reference in New Issue