diff options
author | phosphene47 <phosphene47@chiya.dev> | 2021-12-14 14:20:20 +1100 |
---|---|---|
committer | phosphene47 <phosphene47@chiya.dev> | 2021-12-14 14:20:20 +1100 |
commit | b7ea828bdd98bca4eb188b2c5e5000a2dfccff05 (patch) | |
tree | f38e45c409832d4df5241e80caeb54936726cd9c /lua | |
parent | 0cd9fa1476c499946b636387676df3d0e2723a3c (diff) | |
download | dep-b7ea828bdd98bca4eb188b2c5e5000a2dfccff05.tar.gz dep-b7ea828bdd98bca4eb188b2c5e5000a2dfccff05.tar.bz2 dep-b7ea828bdd98bca4eb188b2c5e5000a2dfccff05.zip |
Ensure cwd is always restored to the original directory on hook failure
Diffstat (limited to '')
-rwxr-xr-x | lua/dep.lua | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lua/dep.lua b/lua/dep.lua index 93d665a..2ae3105 100755 --- a/lua/dep.lua +++ b/lua/dep.lua @@ -248,6 +248,8 @@ local function run_hooks(package, type) for i = 1, #hooks do local ok, err = pcall(hooks[i]) if not ok then + vim.fn.chdir(last_cwd) + package.error = true return false, err end |