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

"ng github-pages:deploy" is fail on 1.0.0-beta.22-1 #3507

Closed
ovrmrw opened this issue Dec 10, 2016 · 4 comments
Closed

"ng github-pages:deploy" is fail on 1.0.0-beta.22-1 #3507

ovrmrw opened this issue Dec 10, 2016 · 4 comments
Assignees
Labels
needs: investigation Requires some digging to determine if action is needed

Comments

@ovrmrw
Copy link

ovrmrw commented Dec 10, 2016

Error message.

Command failed: git clean -f -d
warning: failed to remove src/lib

There was a permissions error during git file operations, please close any open project files/folders and try again.
You might also need to return to the master branch manually.

My Environment.

$ ng --version
angular-cli: 1.0.0-beta.22-1
node: 6.7.0
os: win32 x64

My Solution
(from)

// node_modules/angular-cli/commands/github-pages-deploy.js

        function cleanGhPagesBranch() {
            return execPromise('git ls-files')
                .then(function (stdout) {
                var files = '';
                stdout.split(/\n/).forEach(function (f) {
                    // skip .gitignore & 404.html
                    if ((f != '') && (f != '.gitignore') && (f != '404.html')) {
                        files = files.concat("\"" + f + "\" ");
                    }
                });
                return execPromise("git rm -r " + files);
            });
        }

(to)

        function cleanGhPagesBranch() {
            return execPromise('git ls-files')
                .then(function (stdout) {
                var files = '';
                stdout.split(/\n/).forEach(function (f) {
                    // skip .gitignore & 404.html
                    if ((f != '') && (f != '.gitignore') && (f != '404.html')) {
                        files = files.concat("\"" + f + "\" ");
                    }
                });
                // return execPromise("git rm -r " + files);
                if (files) {
                    return execPromise("git rm -r " + files);
                } else {
                    return execPromise('git ls-files'); // do something
                }
            });
        }

It works.

niwatako pushed a commit to niwatako/hello-angular that referenced this issue Dec 11, 2016
"ng github-pages:deploy" is fail on 1.0.0-beta.22-1 · Issue #3507 · angular/angular-cli
angular/angular-cli#3507
@filipesilva filipesilva added the needs: investigation Requires some digging to determine if action is needed label Dec 12, 2016
@filipesilva filipesilva self-assigned this Dec 12, 2016
@armsc
Copy link

armsc commented Dec 19, 2016

Fix above worked at my end

Thanks @ovrmrw !!

Using Debian Jessie and Node 6.9

@rolyatsats
Copy link
Contributor

rolyatsats commented Dec 19, 2016

I'm responsible for this and am truly sorry. I wish it hadn't been included in 1.0.0-beta.22-1.

It has been fixed as of 1.0.0-beta.23 with the following:

return execPromise(`git rm -r ${files}`)
  .catch(() => {
    // Ignoring errors when trying to erase files.
  });

The issue is simply that git rm -r errors if it's not provided any files. This only happens upon initial deployment as there are no old files yet to remove.

@filipesilva
Copy link
Contributor

Closed via #4385.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: investigation Requires some digging to determine if action is needed
Projects
None yet
Development

No branches or pull requests

4 participants