lukeed / taskr

A fast, concurrency-focused task automation tool.
MIT License
2.53k stars 74 forks source link

Windows: `target` directory contains nested `source` directory #200

Closed devmondo closed 7 years ago

devmondo commented 8 years ago

hi,

awesome project, i just faced little issue, with the below code, Fly creates src as sub dir of dist but i dont want that, what i want is to replicate same structure of src just under dist

const paths = {
    scripts: ['./src/**/*.js']
}

export default async function () {
    await this.watch(paths.scripts, 'babel');
}

export async function babel() {
    await  this.source(paths.scripts)
        .babel({
            presets: [["es2015", {"loose": true, "modules": false}], "stage-1", "stage-3"],
            plugins: ["transform-es2015-modules-commonjs",
                ['transform-runtime', {
                    "polyfill": false,
                    "regenerator": true
                }]
            ],
            sourceMaps: true
        })
        .target(`dist`)
}
hzlmn commented 8 years ago

What version of Fly do you use? I can't reproduce this case

devmondo commented 8 years ago

thanks for prompt response,

version 1.3.1 Windows 10

hzlmn commented 8 years ago

I will look on this at home on Win machine, seems weird. Maybe some problems on win with glob matching.

lukeed commented 7 years ago

I ran into this as well a few days ago. It's definitely a bug on windows only. Our node path handling isn't consistent, but I haven't had time to go thru and find the culprit yet.

lukeed commented 7 years ago

Solved.

Node's path.sep constant is \, even though the OS handles / just fine. What happened was that expand and unwrap were always returning file paths with the / notation, I guess because it's "universal"?

So, when it came time to trim/parse/resolve the target path, the expanded filepaths (containing / only) could not be split by \.

devmondo commented 7 years ago

thank you :)