jostylr / litpro

Minimal command line client for literate programming

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[evo/hello.feature](#hello-feature "save:") does not work in windows

cjloong opened this issue · comments

Hi, when I try to specify subfolder, it seems like it litpro does not work on windows. Specifying the following works:
[evo\hello.feathre]...

I tried to replace code in the cli library and it seems to work.

Old Code

        var fpath = folder.build;
        var fullname = fpath + sep + filename;
        var shortname = fullname.replace(root, "").replace(/^\.\//, '' );
        fpath = fpath + (firstpart ? sep + firstpart : "");

Replacement Code

//OLD:        var fullname = fpath + sep + filename;
        var p = path.parse(fpath + sep + filename);
        var fullname = p.dir + sep + p.base

        var shortname = fullname.replace(root, "").replace(/^\.\//, '' );
//OLD:        fpath = fpath + (firstpart ? sep + firstpart : "");
        fpath = p.dir;

Thanks for the report and code. Should be fixed now.