Skip to content

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

Closed

Description

@ovrmrw

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.

Activity

  1. added a commit that references this issue on Dec 11, 2016
  2. self-assigned this
    on Dec 12, 2016
  3. armsc commented on Dec 19, 2016

    @armsc

    Fix above worked at my end

    Thanks @ovrmrw !!

    Using Debian Jessie and Node 6.9

  4. rolyatsats commented on Dec 19, 2016

    @rolyatsats
    Contributor

    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.

  5. filipesilva commented on Feb 3, 2017

    @filipesilva
    Contributor

    Closed via #4385.

  6. angular-automatic-lock-bot commented on Sep 6, 2019

    @angular-automatic-lock-bot

    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.

  7. locked and limited conversation to collaborators on Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

needs: investigationRequires some digging to determine if action is needed

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions