go-ssb icon indicating copy to clipboard operation
go-ssb copied to clipboard

replace file reading with file execution!

Open mixmix opened this issue 5 years ago • 3 comments

this is a cosmetic PR really. I think you can trim these lines. You might need then to make those files executable and put a #! /usr/bin/env node at the top of the files

mixmix avatar Jun 03 '19 05:06 mixmix

Thanks for dipping your toes in! :) Initially I did pass strings to eval directly from env but it felt way to weird. Looking at it again zoomed out more, I guess it could even be a module and export before and after functions.

cryptix avatar Jun 03 '19 11:06 cryptix

Finally got around to trying this, on go-ssb-room though, where I took the chance to start with a cleaner slate.

I chose to require the scripts (expecting a from of two exported functions) and pass the helpers that were in scope of the eval. The error messages alone make this worth while, not being clouded in somewhere in the eval. Just not sure when I get around to porting the test corpus here but it should definitely happen.

cryptix avatar Jan 27 '21 09:01 cryptix

Not sure on the state of this folks, should it be merged or adapted? @mixmix @cryptix

decentral1se avatar Jul 22 '22 13:07 decentral1se

Unsure of status (https://github.com/ssbc/go-ssb/pull/20#issuecomment-1192563174), unsure folks are coming back to this one. Will close off for now.

decentral1se avatar Nov 07 '22 17:11 decentral1se