Skip to content
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

Fixed format of @sandbox-start pragma in preferences #73

Merged
merged 1 commit into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
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
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
Loading