File tree Expand file tree Collapse file tree 4 files changed +4
-6
lines changed Expand file tree Collapse file tree 4 files changed +4
-6
lines changed Original file line number Diff line number Diff line change 11"use strict" ;
22var validateNpm = require ( 'validate-npm-package-name' ) ;
3- var lodash_kebabcase_1 = require ( 'lodash.kebabcase' ) ;
43function validatePackageName ( name ) {
54 return new Promise ( function ( resolve , reject ) {
65 var validated = validateNpm ( name ) ;
@@ -24,7 +23,7 @@ function validatePackageName(name) {
2423 if ( ! validated . errors && ! validated . warnings ) {
2524 throw {
2625 type : 'error' ,
27- msg : "\nInvalid package name. Try using kebab-case.\n > coderoad create " + lodash_kebabcase_1 . default ( name ) + " \n"
26+ msg : "\nInvalid package name. Try using kebab-case.\n > coderoad create coderoad-your-package- name\n"
2827 } ;
2928 }
3029 }
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ function createFolder(pathToFolder) {
2727}
2828var tutorialFolders = [ [ ] , [ '01' ] , [ '02' ] ] ;
2929var tutorialDemo = [
30+ [ '..' , '.gitignore' ] ,
3031 [ 'tutorial.md' ] ,
3132 [ '01' , 'index.md' ] ,
3233 [ '01' , '01.js' ] ,
@@ -37,7 +38,6 @@ var tutorialDemo = [
3738] ;
3839function createTutorialMd ( dir ) {
3940 return new Promise ( function ( resolve , reject ) {
40- createFile ( dir , '.gitignore' ) ;
4141 var tutorialDir = path_1 . join ( dir , 'tutorial' ) ;
4242 if ( ! node_file_exists_1 . default ( path_1 . join ( tutorialDir ) ) ) {
4343 tutorialFolders . forEach ( function ( folder ) { return createFolder ( path_1 . join . apply ( void 0 , [ dir , 'tutorial' ] . concat ( folder ) ) ) ; } ) ;
Original file line number Diff line number Diff line change 11import * as validateNpm from 'validate-npm-package-name' ;
2- import kebabCase from 'lodash.kebabcase' ;
32
43// TODO: use ../validate/name
54
@@ -27,7 +26,7 @@ export function validatePackageName(name: string): Promise<boolean> {
2726 throw {
2827 type : 'error' ,
2928 msg : `\nInvalid package name. Try using kebab-case.
30- > coderoad create ${ kebabCase ( name ) } \n`
29+ > coderoad create coderoad-your-package- name\n`
3130 } ;
3231 }
3332 }
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ function createFolder(pathToFolder: string): void {
2828const tutorialFolders = [ [ ] , [ '01' ] , [ '02' ] ] ;
2929
3030const tutorialDemo = [
31+ [ '..' , '.gitignore' ] ,
3132 [ 'tutorial.md' ] ,
3233 [ '01' , 'index.md' ] ,
3334 [ '01' , '01.js' ] ,
@@ -39,7 +40,6 @@ const tutorialDemo = [
3940
4041export function createTutorialMd ( dir : string ) : Promise < boolean > {
4142 return new Promise ( ( resolve , reject ) => {
42- createFile ( dir , '.gitignore' ) ;
4343 const tutorialDir = join ( dir , 'tutorial' ) ;
4444 if ( ! fileExists ( join ( tutorialDir ) ) ) {
4545 tutorialFolders . forEach (
You can’t perform that action at this time.
0 commit comments