File tree Expand file tree Collapse file tree 4 files changed +42
-34
lines changed
packages/preview2-shim/lib/browser Expand file tree Collapse file tree 4 files changed +42
-34
lines changed Original file line number Diff line number Diff line change 1- import { _setCwd as fsSetCwd } from './filesystem.js' ;
21import { streams } from './io.js' ;
32const { InputStream, OutputStream } = streams ;
43
5- const symbolDispose = Symbol . dispose ?? Symbol . for ( 'dispose' ) ;
6-
7- let _env = [ ] ,
8- _args = [ ] ,
9- _cwd = '/' ;
10- export function _setEnv ( envObj ) {
11- _env = Object . entries ( envObj ) ;
12- }
13- export function _setArgs ( args ) {
14- _args = args ;
15- }
16-
17- export function _setCwd ( cwd ) {
18- fsSetCwd ( ( _cwd = cwd ) ) ;
19- }
4+ export { _setEnv , _setArgs , environment } from './environment.js' ;
5+ export { _setCwd } from './config.js' ;
206
21- export const environment = {
22- getEnvironment ( ) {
23- return _env ;
24- } ,
25- getArguments ( ) {
26- return _args ;
27- } ,
28- initialCwd ( ) {
29- return _cwd ;
30- } ,
31- } ;
7+ const symbolDispose = Symbol . dispose ?? Symbol . for ( 'dispose' ) ;
328
339class ComponentExit extends Error {
3410 constructor ( code ) {
Original file line number Diff line number Diff line change 1+ // eslint-disable-next-line no-unused-vars
2+ let _cwd = '/' ;
3+
4+ export function _setCwd ( cwd ) {
5+ _cwd = cwd ;
6+ }
Original file line number Diff line number Diff line change 1+ import { _setCwd as fsSetCwd } from './config.js' ;
2+
3+ let _env = [ ] ,
4+ _args = [ ] ,
5+ _cwd = '/' ;
6+
7+ export function _setEnv ( envObj ) {
8+ _env = Object . entries ( envObj ) ;
9+ }
10+
11+ export function _setArgs ( args ) {
12+ _args = args ;
13+ }
14+
15+ export function _setCwd ( cwd ) {
16+ fsSetCwd ( ( _cwd = cwd ) ) ;
17+ }
18+
19+ export const environment = {
20+ getEnvironment ( ) {
21+ return _env ;
22+ } ,
23+ getArguments ( ) {
24+ return _args ;
25+ } ,
26+ initialCwd ( ) {
27+ return _cwd ;
28+ } ,
29+ } ;
Original file line number Diff line number Diff line change 11import { streams } from './io.js' ;
2- import { environment } from './cli .js' ;
2+ import { environment } from './environment .js' ;
33
4- const { InputStream, OutputStream } = streams ;
5-
6- let _cwd = '/' ;
4+ import { _setCwd } from './config.js' ;
5+ export { _setCwd } from './config.js' ;
76
8- export function _setCwd ( cwd ) {
9- _cwd = cwd ;
10- }
7+ const { InputStream, OutputStream } = streams ;
118
129export function _setFileData ( fileData ) {
1310 _fileData = fileData ;
You can’t perform that action at this time.
0 commit comments