Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pushing to wrong project #554

Open
HeavensBlade opened this issue Feb 21, 2019 · 3 comments
Open

Pushing to wrong project #554

HeavensBlade opened this issue Feb 21, 2019 · 3 comments

Comments

@HeavensBlade
Copy link

Working in 2 projects simultaneously seems not to work as intended.

I have two windows powershell terminals open at the same time.
Also two editors.
Lets say I work in projects A and B

Expected Behavior

Change A -> PS C:\a>clasp push -> project A updated
Change B -> PS C:\b>clasp push -> project B updated

Actual Behavior

Change A -> PS C:\a>clasp push -> project A updated
Change B -> PS C:\b>clasp push -> Manifest file has been updated... -> yes -> project A has now content of project B

Steps to Reproduce the Problem

Mentioned above.

Specifications

  • Node version (10.9.0):
  • Version (2.0.1):
  • OS (Windows 10):

Could be the same as
#507
I just found out it was updating the wrong project because one of them is used as a library in the other.

@kaveri-s
Copy link

I faced the same issue as well. In, my case, all updates go only to the latest project I have cloned. Haven't found a workaround yet

@HeavensBlade
Copy link
Author

Hello again.

Since it's been a while and noone else seems to have this problem and I still have it I tried to dig a bit into clasps source.
I added two console.log()s to the file dotfile.js:

PROJECT: function () {
        var projectDirectory = findParentDir.sync(process.cwd(), exports.DOT.PROJECT.PATH) || exports.DOT.PROJECT.DIR;
        console.log('projectDirectory');
        console.log(projectDirectory);
        return dotf(projectDirectory, exports.DOT.PROJECT.NAME);
    },

Now I can confirm, that clasp thinks it is being called from C:\Users\F\ while it is truely being called from C:\Users\F\Documents\Dev\subfolder\subfolder.

In the folder C:\Users\F\ there is .clasp.json file with the ID of the project to wich the project is wrongly pushed.

@HeavensBlade
Copy link
Author

As a workaround I changed the above mentioned function from (originally):

PROJECT: function () {
    var projectDirectory = findParentDir.sync(process.cwd(), exports.DOT.PROJECT.PATH) || exports.DOT.PROJECT.DIR;
    return dotf(projectDirectory, exports.DOT.PROJECT.NAME);
},

to

PROJECT: function () {
    var projectDirectory = process.cwd();
    return dotf(projectDirectory, exports.DOT.PROJECT.NAME);
},

@PopGoesTheWza PopGoesTheWza mentioned this issue May 29, 2019
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants