mirror of
https://github.com/coder/code-server.git
synced 2026-05-05 03:55:18 +02:00
Remove humanPath (#6404)
The tilde is ambiguous and it can be helpful to know exactly what paths code-server is trying to use, especially if it is running as a different user than you expected.
This commit is contained in:
@@ -87,20 +87,6 @@ export function getEnvPaths(platform = process.platform): Paths {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* humanPath replaces the home directory in path with ~.
|
||||
* Makes it more readable.
|
||||
*
|
||||
* @param homedir - the home directory(i.e. `os.homedir()`)
|
||||
* @param path - a file path
|
||||
*/
|
||||
export function humanPath(homedir: string, path?: string): string {
|
||||
if (!path) {
|
||||
return ""
|
||||
}
|
||||
return path.replace(homedir, "~")
|
||||
}
|
||||
|
||||
export const generateCertificate = async (hostname: string): Promise<{ cert: string; certKey: string }> => {
|
||||
const certPath = path.join(paths.data, `${hostname.replace(/\./g, "_")}.crt`)
|
||||
const certKeyPath = path.join(paths.data, `${hostname.replace(/\./g, "_")}.key`)
|
||||
|
||||
Reference in New Issue
Block a user