dx icon indicating copy to clipboard operation
dx copied to clipboard

Can't change the shell before `id` is ran, forces a requirement on `bash` (and `id`)

Open 06kellyjac opened this issue 4 years ago • 3 comments

This section at the bottom of mod.ts runs when imported:

https://github.com/linux-china/dx/blob/master/mod.ts#L451-L459

This is before you can change $.shell to something other than bash such as sh

This means that you must have bash available in order to use sh/ash/dash etc

Also it adds a dependency on id just to set the UID env var which doesn't look useful outside of the test function

https://github.com/linux-china/dx/blob/master/mod.ts#L366-L374

06kellyjac avatar Oct 07 '21 13:10 06kellyjac

@06kellyjac yes, you are right, and I moved GID and UID into test method

linux-china avatar Oct 24 '21 20:10 linux-china

I suppose this also means we cannot use this on Windows yet, correct?

Failed to execute id command: {
  exitCode: 2,
  stdout: "",
  stderr: "-bash: line 2: syntax error near unexpected token `x86'\n-bash: line 2: `HOMEDRIVE=\"C:\"; PROCESSOR_RE..."
}

JosXa avatar Nov 04 '22 23:11 JosXa

git bash/mingw on windows might work

06kellyjac avatar Nov 05 '22 08:11 06kellyjac