File tree Expand file tree Collapse file tree 5 files changed +143
-53
lines changed
Expand file tree Collapse file tree 5 files changed +143
-53
lines changed Original file line number Diff line number Diff line change @@ -3,10 +3,10 @@ const chalk = require('chalk')
33const fs = require ( 'fs' )
44const path = require ( 'path' )
55const prompt = require ( 'prompt' )
6- const slug = require ( 'slug' )
76
87const builds = require ( '../lib/builds' )
98const config = require ( '../lib/config' ) ( )
9+ const slug = require ( '../lib/slug' )
1010
1111module . exports = async ( ) => {
1212 const setDefaults =
@@ -117,8 +117,8 @@ module.exports = async () => {
117117 console . log ( chalk . red ( '× ERROR:' , err ) )
118118 }
119119 } else {
120- const client = slug ( result . c , { lower : true , replacement : '-' } )
121- const alias = slug ( result . a , { lower : true , replacement : '-' } )
120+ const client = slug ( result . c )
121+ const alias = slug ( result . a )
122122 const currentConfig = config . get ( )
123123
124124 let newConfig = { }
Original file line number Diff line number Diff line change @@ -2,7 +2,8 @@ const convert = require('xml-js')
22const fs = require ( 'fs' )
33const os = require ( 'os' ) . type ( )
44const path = require ( 'path' )
5- const slug = require ( 'slug' )
5+
6+ const slug = require ( './slug' )
67
78module . exports = project => {
89 let externalToolBuilders = [ ]
@@ -32,8 +33,7 @@ module.exports = project => {
3233 const name = slug (
3334 path . basename ( path . dirname ( path . dirname ( launch ) ) ) . replace ( '_' , '-' ) +
3435 '_' +
35- path . basename ( launch ) . replace ( '.launch' , '' ) ,
36- { lower : true , replacement : '-' }
36+ path . basename ( launch ) . replace ( '.launch' , '' )
3737 )
3838
3939 // setup placeholder for this config file
Original file line number Diff line number Diff line change 1+ module . exports = text => {
2+ text = text
3+ . toString ( )
4+ . toLowerCase ( )
5+ . trim ( )
6+
7+ const sets = [
8+ {
9+ to : 'a' ,
10+ from : '[ÀÁÂÃÄÅÆĀĂĄẠẢẤẦẨẪẬẮẰẲẴẶ]'
11+ } ,
12+ {
13+ to : 'c' ,
14+ from : '[ÇĆĈČ]'
15+ } ,
16+ {
17+ to : 'd' ,
18+ from : '[ÐĎĐÞ]'
19+ } ,
20+ {
21+ to : 'e' ,
22+ from : '[ÈÉÊËĒĔĖĘĚẸẺẼẾỀỂỄỆ]'
23+ } ,
24+ {
25+ to : 'g' ,
26+ from : '[ĜĞĢǴ]'
27+ } ,
28+ {
29+ to : 'h' ,
30+ from : '[ĤḦ]'
31+ } ,
32+ {
33+ to : 'i' ,
34+ from : '[ÌÍÎÏĨĪĮİỈỊ]'
35+ } ,
36+ {
37+ to : 'j' ,
38+ from : '[Ĵ]'
39+ } ,
40+ {
41+ to : 'ij' ,
42+ from : '[IJ]'
43+ } ,
44+ {
45+ to : 'k' ,
46+ from : '[Ķ]'
47+ } ,
48+ {
49+ to : 'l' ,
50+ from : '[ĹĻĽŁ]'
51+ } ,
52+ {
53+ to : 'm' ,
54+ from : '[Ḿ]'
55+ } ,
56+ {
57+ to : 'n' ,
58+ from : '[ÑŃŅŇ]'
59+ } ,
60+ {
61+ to : 'o' ,
62+ from : '[ÒÓÔÕÖØŌŎŐỌỎỐỒỔỖỘỚỜỞỠỢǪǬƠ]'
63+ } ,
64+ {
65+ to : 'oe' ,
66+ from : '[Œ]'
67+ } ,
68+ {
69+ to : 'p' ,
70+ from : '[ṕ]'
71+ } ,
72+ {
73+ to : 'r' ,
74+ from : '[ŔŖŘ]'
75+ } ,
76+ {
77+ to : 's' ,
78+ from : '[ߌŜŞŠ]'
79+ } ,
80+ {
81+ to : 't' ,
82+ from : '[ŢŤ]'
83+ } ,
84+ {
85+ to : 'u' ,
86+ from : '[ÙÚÛÜŨŪŬŮŰŲỤỦỨỪỬỮỰƯ]'
87+ } ,
88+ {
89+ to : 'w' ,
90+ from : '[ẂŴẀẄ]'
91+ } ,
92+ {
93+ to : 'x' ,
94+ from : '[ẍ]'
95+ } ,
96+ {
97+ to : 'y' ,
98+ from : '[ÝŶŸỲỴỶỸ]'
99+ } ,
100+ {
101+ to : 'z' ,
102+ from : '[ŹŻŽ]'
103+ } ,
104+ {
105+ to : '-' ,
106+ from : "[·/_,:;']"
107+ }
108+ ]
109+
110+ sets . forEach ( set => {
111+ text = text . replace ( new RegExp ( set . from , 'gi' ) , set . to )
112+ } )
113+
114+ text = text
115+ . toString ( )
116+ . toLowerCase ( )
117+ . replace ( / \s + / g, '-' )
118+ . replace ( / & / g, '-and-' )
119+ . replace ( / [ ^ \w - ] + / g, '' )
120+ . replace ( / - - + / g, '-' )
121+ . replace ( / ^ - + / , '' )
122+ . replace ( / - + $ / , '' )
123+
124+ return text
125+ }
Original file line number Diff line number Diff line change 5151 "husky" : " ^1.3.1" ,
5252 "lint-staged" : " ^8.1.0" ,
5353 "minimist" : " ^1.2.0" ,
54- "prettier" : " ^1.15.3" ,
55- "slug" : " ^0.9.3"
54+ "prettier" : " ^1.15.3"
5655 },
5756 "dependencies" : {
5857 "axios" : " ^0.18.0" ,
You can’t perform that action at this time.
0 commit comments