mirror of
https://github.com/coder/code-server.git
synced 2026-11-29 15:57:15 +08:00
feat(testing): refactor humanPath and add tests (#4511)
* feat: add test for humanPath * refactor: make humanPath pure and pass in homedir
This commit is contained in:
1 parent
16a5f2e171
commit
0a072f7532
5 files changed
+31
-12
No files matched your search
+1
-1
@@ -606,7 +606,7 @@ export async function readConfigFile(configPath?: string): Promise<ConfigArgs> {
|
||||
await fs.writeFile(configPath, defaultConfigFile(generatedPassword), {
|
||||
flag: "wx", // wx means to fail if the path exists.
|
||||
})
|
||||
logger.info(`Wrote default config file to ${humanPath(configPath)}`)
|
||||
logger.info(`Wrote default config file to ${humanPath(os.homedir(), configPath)}`)
|
||||
} catch (error: any) {
|
||||
// EEXIST is fine; we don't want to overwrite existing configurations.
|
||||
if (error.code !== "EEXIST") {
|
||||
|
||||
Reference in new issue
Block a user