Skip to content

Commit

Permalink
Fixed format of @sandbox-start pragma in preferences
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanblock committed Feb 3, 2024
1 parent 8b12296 commit af23747
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 7 deletions.
8 changes: 8 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/config/project/prefs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
12 changes: 9 additions & 3 deletions test/integration/preferences-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand All @@ -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"
Expand Down Expand Up @@ -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`,
Expand Down
4 changes: 3 additions & 1 deletion test/mock/max/preferences.arc
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
8 changes: 6 additions & 2 deletions test/unit/src/config/project/prefs/index-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand All @@ -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"
Expand Down

0 comments on commit af23747

Please sign in to comment.