netgusto / nodebook

Nodebook - Multi-Lang Web REPL + CLI Code runner
ISC License
1.63k stars 84 forks source link

fix core/baseservices to use the absolute path #80

Closed talkingtab closed 4 years ago

talkingtab commented 4 years ago

I submitted a patch, but here is a pull request as well.

This patch allows users to enter a relative path on the command line rather than needing an absolute path. I ran into this issue when I installed it and it failed. I traced it down to having used ./foo rather than /other/files/foo.

The new code takes the path in core/baseservices and use Abs() to return the path.

The only issue is that your code has a wrapper around the case where err != nil. I did not follow investigate that part well enough to understand if it was needed, or how it should be done.

netgusto commented 4 years ago

Hey @talkingtab thanks for the fix. I reused your abspath conversion and adapted it a bit here: https://github.com/netgusto/nodebook/pull/83.