Skip to content

Drop Socket versions before 0.5 #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 2 additions & 19 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,21 +170,8 @@ async function main (argv) {
...templates[templateName]?.deps ?? []
]

// remove eventually
let isSocket05orGreater = true

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

try {
const sscVersion = stdout.trim().split(' ')[0]
// split by dot
.split('.')
// convert to numbers
.map(s => parseInt(s))

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

pkg.type = 'module'
pkg.scripts['init-project'] = `ssc init${isSocket05orGreater ? ' --config' : ''}`
pkg.scripts['init-project'] = 'ssc init --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 Down Expand Up @@ -299,10 +286,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