diff --git a/changelog.md b/changelog.md index d693ca4e..433c877b 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,14 @@ --- +## [4.0.1] 2024-02-03 + +### Fixed + +- Fixed format of `@sandbox-start` pragma in preferences (which is preferred to `@sandbox-startup`) + +--- + ## [4.0.0] 2024-01-08 ### Changed diff --git a/src/config/project/prefs/index.js b/src/config/project/prefs/index.js index f6ada23f..953e1a00 100644 --- a/src/config/project/prefs/index.js +++ b/src/config/project/prefs/index.js @@ -59,7 +59,7 @@ module.exports = function getPrefs ({ scope, inventory, errors }) { }) } // Turn Sandbox scripts into commands - if (key === 'sandbox-startup') { + if (key === 'sandbox-start' || key === 'sandbox-startup') { preferences[key] = val.map(v => { if (is.string(v)) return v /* istanbul ignore else: Yet another jic */ diff --git a/test/integration/preferences-test.js b/test/integration/preferences-test.js index 40ec56d2..8b9ecca9 100644 --- a/test/integration/preferences-test.js +++ b/test/integration/preferences-test.js @@ -28,11 +28,13 @@ test('Get global preferences', t => { let cwd = join(mock, 'prefs', 'global') let prefs = { sandbox: { environment: 'testing' }, - 'sandbox-startup': [ + 'sandbox-start': [ 'ls', 'echo hi', 'echo hello', 'echo hello there', + ], + 'sandbox-startup': [ `echo hi there`, `echo hi there`, `echo hi #here`, @@ -47,11 +49,13 @@ test('Get global preferences', t => { @sandbox environment testing -@sandbox-startup +@sandbox-start ls echo hi echo hello echo hello there + +@sandbox-startup echo "hi there" echo 'hi there' echo "hi #here" @@ -93,11 +97,13 @@ test('Get local preferences', t => { let cwd = join(mock, 'max') let prefs = { sandbox: { environment: 'testing' }, - 'sandbox-startup': [ + 'sandbox-start': [ 'ls', 'echo hi', 'echo hello', 'echo hello there', + ], + 'sandbox-startup': [ `echo hi there`, `echo hi there`, `echo hi #here`, diff --git a/test/mock/max/preferences.arc b/test/mock/max/preferences.arc index 914a6615..78d68597 100644 --- a/test/mock/max/preferences.arc +++ b/test/mock/max/preferences.arc @@ -1,11 +1,13 @@ @sandbox environment testing -@sandbox-startup +@sandbox-start ls echo hi echo hello #there echo hello there + +@sandbox-startup echo "hi there" echo 'hi there' echo "hi #here" diff --git a/test/unit/src/config/project/prefs/index-test.js b/test/unit/src/config/project/prefs/index-test.js index 80e56604..51ea9fab 100644 --- a/test/unit/src/config/project/prefs/index-test.js +++ b/test/unit/src/config/project/prefs/index-test.js @@ -38,11 +38,13 @@ test('Get preferences', t => { t.plan(6) let prefs = { sandbox: { environment: 'testing' }, - 'sandbox-startup': [ + 'sandbox-start': [ 'ls', 'echo hi', 'echo hello', 'echo hello there', + ], + 'sandbox-startup': [ `echo hi there`, `echo hi there`, `echo hi #here`, @@ -57,11 +59,13 @@ test('Get preferences', t => { @sandbox environment testing -@sandbox-startup +@sandbox-start ls echo hi echo hello echo hello there + +@sandbox-startup echo "hi there" echo 'hi there' echo "hi #here"