Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Task never ends #6

Open
pastinepolenta opened this issue Oct 2, 2016 · 3 comments
Open

Task never ends #6

pastinepolenta opened this issue Oct 2, 2016 · 3 comments

Comments

@pastinepolenta
Copy link

Here is my script file

try {
    var UACODE = '1234567';

    var replaceinfiles = require('replaceinfiles');

    var options = {
        source: '../build/index.html',
        destPattern: '../build/index.html',
        replaceMap: {
            "[UACODE]": UACODE
        }
    };

    replaceinfiles(options)
        .then(function (report) {
            console.log(report);
        })
        .catch(function (error) {
            console.log(error);
        });
} catch (e){
    console.log(e);
}

This is the file structure

scripts
├── analytics-replace.js
build
├── index.html

I run it with node scripts/analytics-replace.js

The task never ends. Is there something wrong with my code ?

@jackfranklin
Copy link
Contributor

Do you see anything logged out when the task is running or just nothing?

If you could replicate this on a GitHub repo I would be happy to clone it down and take a look.

@pastinepolenta
Copy link
Author

Nothing logged, it just hangs there. I ll try to replicate asap. meanwhile i ve solved it using the CLI command instead of node

@elwynelwyn
Copy link
Contributor

I've got the same issue.

The problem seems to be that the replaceMap option is never used - the code checks for replaceMapPath and if not there falls back to stdin (which is where the silent hang comes from - if you specified options.replaceMap then you're likely not sending anything to stdin...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants