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:
Asher
2023-08-29 15:25:24 -07:00
committed by GitHub
parent eb8099ff89
commit eb498b0d6d
5 changed files with 10 additions and 43 deletions

View File

@@ -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`)