This repository has been archived by the owner on Jun 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: streamline playground detection. prepare for upcoming changes
* playground detection is now more flexible * upgrade to new play script format/concept * update tests
- Loading branch information
1 parent
07f7b30
commit d3b6880
Showing
7 changed files
with
357 additions
and
273 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
build | ||
node_modules | ||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
export function formatShellLog( | ||
initial: string | undefined, | ||
quoted?: string[], | ||
env?: Record<string, string> | ||
): string { | ||
let envString = ''; | ||
if (env !== undefined) { | ||
envString = | ||
Object.entries(env) | ||
.map(([key, value]) => `${key}='${value}'`) | ||
.join(' ') + ' '; | ||
} | ||
|
||
let quotedString = ''; | ||
if (quoted !== undefined && quoted.length !== 0) { | ||
quotedString = quoted.map(q => `'${q}'`).join(' '); | ||
} | ||
|
||
let initialString = (initial ?? '').trim(); | ||
if (initialString !== '' && quotedString !== '') { | ||
initialString = initialString + ' '; | ||
} | ||
|
||
return `$ ${envString}${initialString}${quotedString}`; | ||
} |
Oops, something went wrong.