├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── .gitignore ├── CONTRIBUTING.md ├── README.md ├── index.js ├── languages ├── dart.js ├── go.js ├── maven.js ├── npm.js ├── php.js ├── pip.js ├── ruby.js └── rust.js ├── main.js ├── package.json └── utils └── utils.js /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Did you try clearing npm cache and reinstalling this package ?** 11 | (Yes/No) 12 | 13 | **Describe the bug** 14 | A clear and concise description of what the bug is. 15 | 16 | **To Reproduce** 17 | Steps to reproduce the behavior: 18 | 1. Go to '...' 19 | 2. Click on '....' 20 | 3. Scroll down to '....' 21 | 4. See error 22 | 23 | **Expected behavior** 24 | A clear and concise description of what you expected to happen. 25 | 26 | **Screenshots** 27 | If applicable, add screenshots to help explain your problem. 28 | 29 | **Desktop (please complete the following information):** 30 | - name of commad prompt being used 31 | - version of node 32 | 33 | 34 | **Additional context** 35 | Add any other context about the problem here. 36 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.test 74 | 75 | # parcel-bundler cache (https://parceljs.org/) 76 | .cache 77 | 78 | # Next.js build output 79 | .next 80 | 81 | # Nuxt.js build / generate output 82 | .nuxt 83 | dist 84 | 85 | # Gatsby files 86 | .cache/ 87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 88 | # https://nextjs.org/blog/next-9-1#public-directory-support 89 | # public 90 | 91 | # vuepress build output 92 | .vuepress/dist 93 | 94 | # Serverless directories 95 | .serverless/ 96 | 97 | # FuseBox cache 98 | .fusebox/ 99 | 100 | # DynamoDB Local files 101 | .dynamodb/ 102 | 103 | # TernJS port file 104 | .tern-port 105 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | 2 | # GUIDELINES FOR CONTRIBUTION 3 | 4 | ***Read the following completely.*** 5 | 6 | **In order to communicate with us, please proceed to [discussions tab](https://github.com/kvssankar/git-ultimate-cloner/discussions)** 7 | 8 | ## SETUP 9 | 10 | 1. Fork the repo 11 | 2. Clone It 12 | 3. Open integrated terminal in project folder 13 | 4. npm i -g git-ultimate-cloner 14 | 5. npm link -f 15 | Now whatever the changes u make in index.js will automatically reflect when using quick clone 16 | 17 | ## Creating an Issue 18 | 19 | Please follow the issue template given: 20 | 21 | - Bug report 22 | - Feature Request 23 | 24 | **Any issue which is INACTIVE for 2 days will be assigned to someone else** 25 | 26 | ## Creating a PR 27 | 28 | 1. Please throughly test each and every functionality before sending pull request 29 | 2. If the package breaks the PR will be marked **INVALID** immediately 30 | 3. Dont send multiple PRs for single issue, use the same pr or else will be marked **SPAM** 31 | 32 | **Any PR which is INACTIVE (changes requested are not implemented) for more than 2 days will be marked INVALID** 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Git ultimate cloner 2 | 3 | For contributing please read [this](https://github.com/kvssankar/git-ultimate-cloner/blob/master/CONTRIBUTING.md) 4 | 5 | 6 | ## Use this 😎😎😎 7 | 8 | npm i -g git-ultimate-cloner 9 | 10 | guc clone 11 | 12 | 13 | ## Or this 🥵🥵🥵 14 | 15 | cd desktop 16 | cd projects 17 | git clone 18 | cd repository-name 19 | code . 20 | open terminal in vs code 21 | npm install 22 | cd client 23 | npm install 24 | cd .. 25 | cd server 26 | npm install 27 | cd .. 28 | npm run dev 29 | 30 | # What does it do? 31 | 32 | 1. Clones your repo 33 | 2. Installs all the npm packages Or dart, php... [find more](https://github.com/kvssankar/git-ultimate-cloner/blob/master/README.md#supports-various-package-managers)present in the repo (even the inner folders). 34 | 3. Opens your repositoy in your favorite ide 35 | 36 | All in a single step 🤩🤩🤩 37 | 38 | 4. Set your default path so that **WHEREVER** you open your command prompt it will clone into the path you set 39 | 40 | Example: Your projects folder (Open cmd in any folder and it will clone into your projects folder) 41 | 42 | ## Documentation 43 | 44 | > For usage details: guc --help 45 | 46 | 1. To simply clone: 47 | 48 | ``` 49 | guc clone 50 | ``` 51 | 52 | 2. To set default path to clone into: 53 | 54 | guc set-folder default "C:\Users\SANKAR KUMAR\Desktop\projects" 55 | 56 | 3. If u set a default folder but want to clone into current folder then: 57 | 58 | guc clone --folder current 59 | 60 | 4. Set more custom folders to clone ur projects into respective folders: 61 | 62 | guc set-folder myfolder "C:\Users\SANKAR KUMAR\Desktop\projects\myfolder" 63 | 64 | 5. To clone into custom folder: 65 | 66 | guc clone --folder myfolder 67 | 68 | 6. To open in your atom ide (by default opens in vscode): 69 | 70 | guc clone --ide atom 71 | 72 | 7. To set default ide: 73 | 74 | guc set-ide atom 75 | 76 | # Currently supported various package managers: 77 | 78 | Automatically searches and installs... 79 | 80 | 1. NPM Packages 81 | 2. PHP Modules 82 | 3. Yarn and pnpm 83 | 4. Dart Packages 84 | 5. Ruby Gems 85 | 6. Rust Crates 86 | 7. Go Packages 87 | 8. Maven Dependencies 88 | 89 | > For more feature suggestions visit: 90 | 91 | [GitHub Repo](https://github.com/kvssankar/git-ultimate-cloner.git) 92 | 93 | ## Prerequsites 94 | 95 | 1. [NodeJS](https://nodejs.org/en/) installed. 96 | 2. [git](https://git-scm.com/) installed globally. 97 | 98 | ## Contributors 99 | 100 | ## Contributors 101 | 102 | 103 | 104 | 118 | 132 | 146 | 147 |
105 | Kvs Sankar Kumar 106 |

107 | Kvs Sankar Kumar 108 |

109 |

110 | 111 | GitHub 112 | 113 | 114 | LinkedIn 115 | 116 |

117 |
119 | Tanmay Vyas 120 |

121 | Tanmay Vyas 122 |

123 |

124 | 125 | GitHub 126 | 127 | 128 | LinkedIn 129 | 130 |

131 |
133 | Dev Sharma 134 |

135 | Dev Sharma 136 |

137 |

138 | 139 | GitHub 140 | 141 | 142 | LinkedIn 143 | 144 |

145 |
148 | 149 | --- 150 | 151 | ```javascript 152 | if (youLikedOurPackage) { 153 | starThisRepository(); 154 | } 155 | ``` 156 | 157 | --- 158 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | const { program } = require("commander"); 3 | const shell = require("shelljs"); 4 | const colors = require("colors"); 5 | const run = require("./main"); 6 | const store = require("data-store")("guc"); 7 | 8 | async function main() { 9 | program 10 | .name("git-ultimate-cloner") 11 | .description("Smarter way to clone git repositories.") 12 | .version("4.0.0"); 13 | 14 | program 15 | .command("set-folder ") 16 | .description( 17 | "Set a custom folder to clone into.To set default folder, use 'default' as folderName. Use quotes in path if it contains spaces." 18 | ) 19 | .action((folderName, path) => { 20 | if (!shell.test("-d", path)) { 21 | console.log("Invalid path"); 22 | return; 23 | } 24 | if (folderName === "ide") { 25 | console.log("Cannot name folder 'ide'."); 26 | return; 27 | } 28 | if (folderName === "current") { 29 | console.log("Cannot name folder 'current'."); 30 | return; 31 | } 32 | store.set(folderName, path); 33 | console.log("Set folder", folderName, path); 34 | }); 35 | 36 | program 37 | .command("delete-folder ") 38 | .description("Delete a custom folder.") 39 | .action((folderName) => { 40 | if (store.has(folderName)) { 41 | store.del(folderName); 42 | console.log("Deleted folder", folderName); 43 | } else { 44 | console.log("Folder not found"); 45 | } 46 | }); 47 | 48 | program 49 | .command("list-folders") 50 | .description("List all custom folders.") 51 | .action(() => { 52 | console.log(store.data); 53 | }); 54 | 55 | program 56 | .command("clear-folders") 57 | .description("Clear all custom folders.") 58 | .action(() => { 59 | store.clear(); 60 | console.log("Cleared all folders"); 61 | }); 62 | 63 | program 64 | .command("update-folder ") 65 | .description("Update a custom folder.") 66 | .action((folderName, path) => { 67 | if (!shell.test("-d", path)) { 68 | console.log("Invalid path"); 69 | return; 70 | } 71 | if (folderName === "ide") { 72 | console.log("Cannot name folder 'ide'."); 73 | return; 74 | } 75 | if (folderName === "current") { 76 | console.log("Cannot name folder 'current'."); 77 | return; 78 | } 79 | if (store.has(folderName)) { 80 | store.set(folderName, path); 81 | console.log("Updated folder", folderName, path); 82 | } else { 83 | console.log("Folder not found"); 84 | } 85 | }); 86 | 87 | program 88 | .command("set-ide ") 89 | .description("Set the default ide to open the cloned repository in.") 90 | .action((ide) => { 91 | store.set("ide", ide); 92 | console.log("Set ide", ide); 93 | }); 94 | 95 | //add custom help 96 | program.addHelpText( 97 | "after", 98 | ` 99 | Examples: 100 | 101 | Cloning a repository into a custom folder: 102 | $ guc clone 103 | $ guc clone -f 104 | $ guc clone -f current //clone into current folder 105 | 106 | Cloning a repository into a custom folder and opening it in an editor: 107 | 108 | NOTE: BY default, the editor is set to vscode. 109 | $ guc clone -f -i //editors: vscode, atom, sublime 110 | 111 | Setting a custom folder: 112 | $ guc set-folder 113 | $ guc set-folder default //to always clone into a particular folder 114 | 115 | Deleting a custom folder: 116 | $ guc delete-folder 117 | 118 | Listing all custom folders: 119 | $ guc list-folders 120 | 121 | Clearing all custom folders: 122 | $ guc clear-folders 123 | 124 | Updating a custom folder: 125 | $ guc update-folder 126 | 127 | Setting the default ide: 128 | $ guc set-ide //editors: vscode, atom, sublime 129 | ` 130 | ); 131 | 132 | program 133 | .command("clone ") 134 | .description("Clone a git repository.") 135 | .option("-i, --ide ", "Open the cloned repository in an editor.") 136 | .option("-f, --folder ", "Clone the repository into a folder.") 137 | .action(run); 138 | 139 | program.showHelpAfterError(); 140 | 141 | await program.parseAsync(process.argv); 142 | } 143 | 144 | main(); 145 | -------------------------------------------------------------------------------- /languages/dart.js: -------------------------------------------------------------------------------- 1 | const shell = require("shelljs"); 2 | const colors = require("colors"); 3 | const Spinner = require("cli-spinner").Spinner; 4 | 5 | var depSpin = new Spinner("%s"); 6 | depSpin.setSpinnerString("|/-\\"); 7 | 8 | const dart_packages = () => { 9 | return new Promise((resolve) => { 10 | if (!shell.test("-f", "pubspec.yaml")) { 11 | resolve(); 12 | } else { 13 | console.log("\nDart packages are being installed...".blue); 14 | depSpin.start(); 15 | shell.exec(`dart pub get`, () => { 16 | depSpin.stop(); 17 | console.log("\nDart packages got installed\n".green); 18 | resolve(); 19 | }); 20 | } 21 | }); 22 | }; 23 | 24 | module.exports = dart_packages; 25 | -------------------------------------------------------------------------------- /languages/go.js: -------------------------------------------------------------------------------- 1 | const shell = require("shelljs"); 2 | const colors = require("colors"); 3 | const Spinner = require("cli-spinner").Spinner; 4 | 5 | var depSpin = new Spinner("%s"); 6 | depSpin.setSpinnerString("|/-\\"); 7 | 8 | const go_deps = () => { 9 | return new Promise((resolve) => { 10 | if (!shell.test("-f", "go.mod")) { 11 | resolve(); 12 | } else { 13 | console.log("\nGo dependencies are being installed...".blue); 14 | depSpin.start(); 15 | shell.exec(`go mod tidy`, () => { 16 | depSpin.stop(); 17 | console.log("\nGo dependencies got installed\n".green); 18 | resolve(); 19 | }); 20 | } 21 | }); 22 | }; 23 | 24 | module.exports = go_deps; 25 | -------------------------------------------------------------------------------- /languages/maven.js: -------------------------------------------------------------------------------- 1 | const shell = require("shelljs"); 2 | const colors = require("colors"); 3 | const Spinner = require("cli-spinner").Spinner; 4 | 5 | var depSpin = new Spinner("%s"); 6 | depSpin.setSpinnerString("|/-\\"); 7 | 8 | const maven_deps = () => { 9 | return new Promise((resolve) => { 10 | if (!shell.test("-f", "pom.xml")) { 11 | resolve(); 12 | } else { 13 | console.log("\nMaven dependencies are being installed...".blue); 14 | depSpin.start(); 15 | shell.exec(`mvn clean install`, () => { 16 | depSpin.stop(); 17 | console.log("\nMaven dependencies got installed".green); 18 | resolve(); 19 | }); 20 | } 21 | }); 22 | }; 23 | 24 | module.exports = maven_deps; 25 | -------------------------------------------------------------------------------- /languages/npm.js: -------------------------------------------------------------------------------- 1 | const shell = require("shelljs"); 2 | const colors = require("colors"); 3 | const Spinner = require("cli-spinner").Spinner; 4 | 5 | var depSpin = new Spinner("%s"); 6 | depSpin.setSpinnerString("|/-\\"); 7 | 8 | const npm_packages = () => { 9 | return new Promise((resolve) => { 10 | if (!shell.test("-f", "package.json")) { 11 | resolve(); 12 | } else { 13 | console.log("\nNpm packages are being installed...".blue); 14 | if (shell.test("-f", "yarn.lock")) { 15 | console.log("\nUsing yarn".blue); 16 | depSpin.start(); 17 | shell.exec(`yarn install`, () => { 18 | depSpin.stop(); 19 | console.log("\nNpm packages got installed\n".green); 20 | resolve(); 21 | }); 22 | } else if (shell.test("-f", "pnpm-lock.yaml")) { 23 | console.log("\nUsing pnpm".blue); 24 | depSpin.start(); 25 | shell.exec(`pnpm install`, () => { 26 | depSpin.stop(); 27 | console.log("\nNpm packages got installed\n".green); 28 | resolve(); 29 | }); 30 | } else { 31 | console.log("\nUsing npm".blue); 32 | depSpin.start(); 33 | shell.exec(`npm install`, () => { 34 | depSpin.stop(); 35 | console.log("\nNpm packages got installed\n".green); 36 | resolve(); 37 | }); 38 | } 39 | } 40 | }); 41 | }; 42 | 43 | module.exports = npm_packages; 44 | -------------------------------------------------------------------------------- /languages/php.js: -------------------------------------------------------------------------------- 1 | const shell = require("shelljs"); 2 | const colors = require("colors"); 3 | const Spinner = require("cli-spinner").Spinner; 4 | 5 | var depSpin = new Spinner("%s"); 6 | depSpin.setSpinnerString("|/-\\"); 7 | 8 | const php_modules = () => { 9 | return new Promise((resolve) => { 10 | if (!shell.test("-f", "composer.json")) { 11 | resolve(); 12 | } else { 13 | console.log("\nPHP modules are being installed...".blue); 14 | depSpin.start(); 15 | shell.exec(`php composer.phar install`, () => { 16 | depSpin.stop(); 17 | console.log("\nPHP modules got installed\n".green); 18 | resolve(); 19 | }); 20 | } 21 | }); 22 | }; 23 | 24 | module.exports = php_modules; 25 | -------------------------------------------------------------------------------- /languages/pip.js: -------------------------------------------------------------------------------- 1 | const shell = require("shelljs"); 2 | const colors = require("colors"); 3 | const Spinner = require("cli-spinner").Spinner; 4 | 5 | var depSpin = new Spinner("%s"); 6 | depSpin.setSpinnerString("|/-\\"); 7 | 8 | const pip_packages = () => { 9 | return new Promise((resolve) => { 10 | if (!shell.test("-f", "requirements.txt")) { 11 | resolve(); 12 | } else { 13 | console.log("\nPip packages are being installed...".blue); 14 | depSpin.start(); 15 | shell.exec(`pip install -r requirements.txt`, () => { 16 | depSpin.stop(); 17 | console.log("\nPip packages got installed\n".green); 18 | resolve(); 19 | }); 20 | } 21 | }); 22 | }; 23 | 24 | module.exports = pip_packages; 25 | -------------------------------------------------------------------------------- /languages/ruby.js: -------------------------------------------------------------------------------- 1 | const shell = require("shelljs"); 2 | const colors = require("colors"); 3 | const Spinner = require("cli-spinner").Spinner; 4 | 5 | var depSpin = new Spinner("%s"); 6 | depSpin.setSpinnerString("|/-\\"); 7 | 8 | const ruby_gems = () => { 9 | return new Promise((resolve) => { 10 | if (!shell.test("-f", "Gemfile")) { 11 | resolve(); 12 | } else { 13 | console.log("\nRuby gems are being installed...".blue); 14 | depSpin.start(); 15 | shell.exec(`bundle install`, () => { 16 | depSpin.stop(); 17 | console.log("\nRuby gems got installed\n".green); 18 | resolve(); 19 | }); 20 | } 21 | }); 22 | }; 23 | 24 | module.exports = ruby_gems; 25 | -------------------------------------------------------------------------------- /languages/rust.js: -------------------------------------------------------------------------------- 1 | const shell = require("shelljs"); 2 | const colors = require("colors"); 3 | const Spinner = require("cli-spinner").Spinner; 4 | 5 | var depSpin = new Spinner("%s"); 6 | depSpin.setSpinnerString("|/-\\"); 7 | 8 | const rust_crates = () => { 9 | return new Promise((resolve) => { 10 | if (!shell.test("-f", "Cargo.toml")) { 11 | resolve(); 12 | } else { 13 | console.log("\nRust crates are being installed...".blue); 14 | depSpin.start(); 15 | shell.exec(`cargo build`, () => { 16 | depSpin.stop(); 17 | console.log("\nRust crates got installed\n".green); 18 | resolve(); 19 | }); 20 | } 21 | }); 22 | }; 23 | 24 | module.exports = rust_crates; 25 | -------------------------------------------------------------------------------- /main.js: -------------------------------------------------------------------------------- 1 | const shell = require("shelljs"); 2 | const colors = require("colors"); 3 | const store = require("data-store")("guc"); 4 | 5 | const { getAppname, check, install_npm_packages } = require("./utils/utils"); 6 | 7 | const run = async (url, options) => { 8 | check(); 9 | 10 | const appname = getAppname(url); 11 | if (appname === null) { 12 | shell.echo("Please enter a valid url".red); 13 | shell.exit(1); 14 | } 15 | 16 | let folder = options.folder; 17 | if (folder !== undefined) { 18 | if (folder === "current") { 19 | folder = shell.pwd(); 20 | } else if (store.has(folder)) { 21 | folder = store.get(folder); 22 | } 23 | } 24 | if (folder === undefined) { 25 | if (store.has("default")) { 26 | folder = store.get("default"); 27 | } 28 | } 29 | if (folder === undefined) { 30 | folder = shell.pwd(); 31 | } 32 | 33 | shell.cd(folder); 34 | shell.exec(`git clone ${url}`); 35 | await install_npm_packages(appname); 36 | 37 | shell.cd(appname); 38 | 39 | const folders = shell.ls("-d", "*"); 40 | for (let i = 0; i < folders.length; i++) { 41 | await install_npm_packages(folders[i]); 42 | } 43 | 44 | let ide = options.ide || store.get("ide"); 45 | if (ide) { 46 | console.log("Opening in", ide); 47 | if (ide === "vscode") { 48 | shell.exec(`code .`); 49 | } else if (ide === "atom") { 50 | shell.exec(`atom .`); 51 | } else if (ide === "sublime") { 52 | shell.exec(`subl .`); 53 | } else { 54 | shell.echo( 55 | "Please enter a valid editor.\n Right now we support only [vscode,atom,sublime]" 56 | .red 57 | ); 58 | shell.exit(1); 59 | } 60 | } else { 61 | if (shell.which("code")) { 62 | shell.exec(`code .`); 63 | } 64 | } 65 | shell.exit(200); 66 | }; 67 | 68 | module.exports = run; 69 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "git-ultimate-cloner", 3 | "version": "4.0.0", 4 | "description": "Are you tried of cloning repo, opening in vs-code and installing packages in various folders... No more use git-ultimate-cloner and make your life simple", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [ 10 | "github", 11 | "git clone", 12 | "cli", 13 | "gitlab", 14 | "npm install", 15 | "git-ultimate-cloner", 16 | "quick clone", 17 | "args", 18 | "argv" 19 | ], 20 | "repository": { 21 | "type": "git", 22 | "url": "https://github.com/kvssankar/git-ultimate-cloner-npm.git" 23 | }, 24 | "author": "KVSSK", 25 | "license": "MIT", 26 | "bugs": { 27 | "url": "https://github.com/kvssankar/git-ultimate-cloner-npm/issues" 28 | }, 29 | "bin": { 30 | "guc": "index.js" 31 | }, 32 | "homepage": "https://github.com/kvssankar/git-ultimate-cloner-npm#readme", 33 | "dependencies": { 34 | "cli-spinner": "^0.2.10", 35 | "colors": "^1.4.0", 36 | "commander": "^9.4.1", 37 | "data-store": "^4.0.3", 38 | "hyperlinker": "^1.0.0", 39 | "shelljs": "^0.8.4" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /utils/utils.js: -------------------------------------------------------------------------------- 1 | const shell = require("shelljs"); 2 | const colors = require("colors"); 3 | const npm_packages = require("../languages/npm"); 4 | const dart_packages = require("../languages/dart"); 5 | const go_deps = require("../languages/go"); 6 | const pip_packages = require("../languages/pip"); 7 | const rust_crates = require("../languages/rust"); 8 | const php_modules = require("../languages/php"); 9 | const ruby_gems = require("../languages/ruby"); 10 | const maven_deps = require("../languages/maven"); 11 | 12 | const getAppname = (url) => { 13 | if (url == null) { 14 | return null; 15 | } 16 | if (url.startsWith("https://")) { 17 | return url.split("/")[4].replace(".git", ""); 18 | } else if (url.startsWith("git@")) { 19 | return url.split("/")[1].replace(".git", ""); 20 | } else { 21 | return; 22 | } 23 | }; 24 | 25 | const check = () => { 26 | return new Promise((resolve) => { 27 | if (!shell.which("git")) { 28 | shell.echo( 29 | "\nSorry, this script requires git installed globally :(\n".red 30 | ); 31 | } 32 | resolve(); 33 | }); 34 | }; 35 | 36 | async function install_npm_packages(folder) { 37 | if (shell.test("-d", folder)) { 38 | console.log("Checking for dependencies in".blue, folder); 39 | shell.cd(folder); 40 | await npm_packages(); 41 | await dart_packages(); 42 | await go_deps(); 43 | await pip_packages(); 44 | await rust_crates(); 45 | await php_modules(); 46 | await ruby_gems(); 47 | await maven_deps(); 48 | shell.cd(".."); 49 | } 50 | } 51 | 52 | module.exports = { getAppname, check, install_npm_packages }; 53 | --------------------------------------------------------------------------------