Skip to content

Commit

Permalink
Drop Socket versions before 0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
chicoxyzzy committed Jan 8, 2024
1 parent 47cf955 commit 4fa9abd
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,6 @@ async function main (argv) {
...templates[templateName]?.deps ?? []
]

// remove eventually
let isSocket05orGreater = true

try {
const { stdout } = await exec('ssc --version')

Expand All @@ -182,8 +179,6 @@ async function main (argv) {
.split('.')
// convert to numbers
.map(s => parseInt(s))

isSocket05orGreater = sscVersion[0] >= 1 || sscVersion[1] >= 5
} catch (err) {}
} catch (err) {
process.stdout.write('Installing \'@socketsupply/socket\' locally (ssc not in PATH)\n')
Expand All @@ -210,7 +205,6 @@ async function main (argv) {
}

pkg.type = 'module'
pkg.scripts['init-project'] = `ssc init${isSocket05orGreater ? ' --config' : ''}`
pkg.scripts.start = 'ssc build -r -o'
pkg.scripts.build = 'ssc build -o'
pkg.scripts.test = 'ssc build -r -o --test=./test/index.js --headless'
Expand All @@ -231,8 +225,8 @@ async function main (argv) {
process.stdout.write('Creating socket files...')
// Use spawn so we can pass stdio, fte is interactive
const initProcess = spawn(
`npm${os.platform() === 'win32' ? '.cmd' : ''}`,
['run', 'init-project'],
'ssc',
['init', '--config'],
{
stdio: [process.stdin, process.stdout, process.stderr]
})
Expand Down Expand Up @@ -299,10 +293,6 @@ async function main (argv) {
if (line.includes('script = ')) {
return line.replace(line, 'script = "node build.js"')
}
// Socket 0.5 compatibility
if (isSocket05orGreater && line.includes('forward_arguments = ')) {
return line.replace(line, 'forward_arguments = true')
}
return line
}).join('\n')

Expand Down

0 comments on commit 4fa9abd

Please sign in to comment.