Socket
Socket
Sign inDemoInstall

kick-init

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kick-init - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

77

argsParser.js

@@ -5,2 +5,3 @@ 'use strict';

const path = require('path');
const pj = ('./package.json');

@@ -13,9 +14,15 @@ //configuration path

//check package version
const version = require("./package.json").version;
//get repo urls with property name
const rawRepos = Object.keys(repoList.repos).map(repo => {
return `${repo}. ${repoList.repos[repo]}`;
}).toString().replace(/,/g, "\n ");
//output for list flag
const repos = `
Starter Repo List:
a: ${repoList.repos.a}
b: ${repoList.repos.b}
`;
${rawRepos}
`

@@ -32,2 +39,3 @@ //output for help flag

-r, --remote create a remote repo for this project
-v, --version get current version of kick-init package

@@ -37,4 +45,3 @@ [repo] specify the repo to clone, defaults to "a"

Starter Repo List:
a: ${repoList.repos.a}
b: ${repoList.repos.b}
${rawRepos}
`;

@@ -45,4 +52,2 @@

// let configFile = false;
const argsParser = (args) => {

@@ -65,13 +70,15 @@

//check if there are more than one argument and then make sure it is -r flag
if (length > 1 && !regex.exec(args[length - 1]) && !args[0].includes('-c')) {
console.log('ERROR: The last argument must either be the "-r" or "--remote" flag');
throw new Error;
}
//parse each argument
args.map((arg, i) => {
//parse each argument
args.map(arg => {
console.log("test", repoList.repos[arg])
// if argument is passed serve up appropriate object
switch (arg) {
case '-v':
console.log(pj.version);
info = null;
break;
case '--version':
console.log(pj.version);
info = null;
break;
case '-l':

@@ -86,3 +93,3 @@ console.log(repos);

case '-c':
info.clone = args[1];
info.clone = args[i + 1];
break;

@@ -100,36 +107,2 @@ case '--clone':

break;
case 'a':
break;
case 'b':
if (repoList.repos.b) {
info.clone = repoList.repos.b;
} else {
console.log(`ERROR: ${arg} is not a boilerplate.`);
throw new Error;
}
break;
case 'c':
if (repoList.repos.c) {
info.clone = repoList.repos.c;
} else {
console.log(`ERROR: ${arg} is not a boilerplate.`);
throw new Error;
}
break;
case 'd':
if (repoList.repos.d) {
info.clone = repoList.repos.d;
} else {
console.log(`ERROR: ${arg} is not a boilerplate.`);
throw new Error;
}
break;
case 'e':
if (repoList.repos.e) {
info.clone = repoList.repos.e;
} else {
console.log(`ERROR: ${arg} is not a boilerplate.`);
throw new Error;
}
break;
case '-r':

@@ -145,3 +118,3 @@ info.remote = true;

}
else if (!arg.includes('https')) {
else if (!arg.includes('://')) {
console.log(`ERROR: ${arg} is not valid argument.`);

@@ -152,3 +125,3 @@ throw new Error;

});
// console.log(info);
console.log(info);
return info;

@@ -155,0 +128,0 @@ };

@@ -9,9 +9,9 @@ 'use strict';

module.exports = (args) => {
module.exports = (args) => {
//parse arguments and pass to git.js
let info = argsParser(args);
if (info) {
git(info);
}
// if (info) {
// git(info);
// }
};
{
"name": "kick-init",
"version": "1.0.6",
"version": "1.0.7",
"description": "cli tool for getting your new project a kick start!",
"main": "index.js",
"repository": "https://github.com/davidicus/kick-starter.git",
"repository": "https://github.com/davidicus/kick-init.git",
"author": {

@@ -8,0 +8,0 @@ "name": "David Conner",

@@ -10,10 +10,22 @@

# kick-init [![Build Status](https://travis-ci.org/davidicus/awesome-project.svg?branch=master)](https://travis-ci.org/davidicus/awesome-project)
> Give your new project a kick!
##Usage
##What it do
Drastically reduce the time it take to spin up a new project. Even with a starter boilerplate the time you spend setting it up for a new project can add up. With kick-init a single command will have your starter project up and running in a matter of minutes.
Drastically reduce the time it take to spin up a new project. Even with a starter boilerplate the time you spend setting it up for a new project can add up. With kick-init a single command will have your starter project up and running in a matter of minutes.
*When used to full potential kick-init will:*
- clone starter repo into current directory
- delete old .git history
- initialize new git repository
- run `npm install`
- add all files to staging
- create your first commit
- create your remote repo (with `-r` flag)
- add remote repo to local project (with `-r` flag)
- push up all files to new remote repo (with `-r` flag)
## Install

@@ -28,2 +40,4 @@

`kick` is the only necessary command to get started. All arguments and flags are optional. The repo defaults to the first one listed in the config file or the default if no config is present. kick-init defaults to not creating a remote repo but can be added with the `-r`flag.
```

@@ -42,2 +56,3 @@

-r, --remote create a remote repo for this project
-v, --version get current version of kick-init package

@@ -59,4 +74,4 @@ [repo] specify the repo to clone [a-e], defaults to "a"

In order to get the full benefits of kick-init add a .kickconfig.json file to your root directory. There are two sections of the config. The **repos** property will list out all repos available to clone. The second property is **github**. Here you will list your username and personal access token. Check out how to get a personal access token [here](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/). Without the config file you will not be able to create a remote repo but can still start a local project. Get ta kickin!
```

@@ -73,3 +88,3 @@

"github": {
"token": "your-token",
"token": "yourToken",
"username": "yourUserName"

@@ -81,6 +96,6 @@ }

In order to get the full benefits of kick-init add a .kickconfig.json file to your root directory. There are two sections of the config. The **repos** property will list out all repos available to clone. The second property is **github**. Here you will list your username and personal access token. Check out how to get a personal access token [here](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/). Without the config file you will not be able to create a remote repo but can still start a local project. Get ta kickin!
## License
MIT © [David Conner](http://david-conner.com)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc