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

Error: 'git checkout' failed with status 1 #2

Closed
MShineRay opened this issue Sep 27, 2021 · 2 comments
Closed

Error: 'git checkout' failed with status 1 #2

MShineRay opened this issue Sep 27, 2021 · 2 comments

Comments

@MShineRay
Copy link
Owner

npm i @a0znpm/fecli -g
fe create testPro

MShineRay pushed a commit that referenced this issue Oct 8, 2021
@MShineRay
Copy link
Owner Author

MShineRay commented Oct 8, 2021

node-module: donload-git-repo
set checkout to 'false'

function normalize (repo) {
    var regex = /^(?:(direct):([^#]+)(?:#(.+))?)$/
    var match = regex.exec(repo)

    if (match) {
        var url = match[2]
        var directCheckout = match[3] || 'master'

        return {
            type: 'direct',
            url: url,
            checkout: false //directCheckout 
        }
    } else {
        regex = /^(?:(github|gitlab|bitbucket):)?(?:(.+):)?([^/]+)\/([^#]+)(?:#(.+))?$/
        match = regex.exec(repo)
        var type = match[1] || 'github'
        var origin = match[2] || null
        var owner = match[3]
        var name = match[4]
        var checkout = match[5] || 'master'

        if (origin == null) {
            if (type === 'github') {
                origin = 'github.com'
            } else if (type === 'gitlab') {
                origin = 'gitlab.com'
            } else if (type === 'bitbucket') {
                origin = 'bitbucket.org'
            }
        }

        return {
            type: type,
            origin: origin,
            owner: owner,
            name: name,
            checkout: checkout
        }
    }
}

MShineRay pushed a commit that referenced this issue Oct 8, 2021
MShineRay pushed a commit that referenced this issue Oct 8, 2021
@MShineRay
Copy link
Owner Author

const download = require('download-git-repo');
set download opt.checkout=false

demo:
download(gitUrl, answers.projectName, {clone: true,checkout:false, depth:1}, (err) => {

})

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

1 participant