Skip to content

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

Closed
@ovrmrw

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.

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