mumoshu / variant2

Turn your bash scripts into a modern, single-executable CLI app today
MIT License
141 stars 11 forks source link

Embed local imports and cached remote imports into binary #32

Closed mumoshu closed 3 years ago

mumoshu commented 3 years ago

variant export binary should now emit a binary containing all the local imports and cached remote imports in it.

Under the hood, it uses statik for embedding all the files present in the source directory and the cached remote imports.

All the remote imports are resolved and cached to $TEMPDIR/.variant2/cache on running variant export binary. It's like what happen when you run variant run, but the cache is persisted in the temporary directory that contains the exported Go project tree with all the embedded files.

Note that variant export binary uses variant export go internally so the latter command is affected as well.

Resolves #28