@@ -170,21 +170,8 @@ async function main (argv) {
170
170
...templates [ templateName ] ?. deps ?? [ ]
171
171
]
172
172
173
- // remove eventually
174
- let isSocket05orGreater = true
175
-
176
173
try {
177
- const { stdout } = await exec ( 'ssc --version' )
178
-
179
- try {
180
- const sscVersion = stdout . trim ( ) . split ( ' ' ) [ 0 ]
181
- // split by dot
182
- . split ( '.' )
183
- // convert to numbers
184
- . map ( s => parseInt ( s ) )
185
-
186
- isSocket05orGreater = sscVersion [ 0 ] >= 1 || sscVersion [ 1 ] >= 5
187
- } catch ( err ) { }
174
+ await exec ( 'ssc --version' )
188
175
} catch ( err ) {
189
176
process . stdout . write ( 'Installing \'@socketsupply/socket\' locally (ssc not in PATH)\n' )
190
177
deps . push ( '@socketsupply/socket' )
@@ -210,7 +197,6 @@ async function main (argv) {
210
197
}
211
198
212
199
pkg . type = 'module'
213
- pkg . scripts [ 'init-project' ] = `ssc init${ isSocket05orGreater ? ' --config' : '' } `
214
200
pkg . scripts . start = 'ssc build -r -o'
215
201
pkg . scripts . build = 'ssc build -o'
216
202
pkg . scripts . test = 'ssc build -r -o --test=./test/index.js --headless'
@@ -231,8 +217,8 @@ async function main (argv) {
231
217
process . stdout . write ( 'Creating socket files...' )
232
218
// Use spawn so we can pass stdio, fte is interactive
233
219
const initProcess = spawn (
234
- `npm ${ os . platform ( ) === 'win32' ? '.cmd' : '' } ` ,
235
- [ 'run ' , 'init-project ' ] ,
220
+ 'ssc' ,
221
+ [ 'init ' , '--config ' ] ,
236
222
{
237
223
stdio : [ process . stdin , process . stdout , process . stderr ]
238
224
} )
@@ -299,10 +285,6 @@ async function main (argv) {
299
285
if ( line . includes ( 'script = ' ) ) {
300
286
return line . replace ( line , 'script = "node build.js"' )
301
287
}
302
- // Socket 0.5 compatibility
303
- if ( isSocket05orGreater && line . includes ( 'forward_arguments = ' ) ) {
304
- return line . replace ( line , 'forward_arguments = true' )
305
- }
306
288
return line
307
289
} ) . join ( '\n' )
308
290
0 commit comments