mirror of
https://github.com/coder/code-server.git
synced 2026-05-06 12:31:58 +02:00
12 lines
375 B
TypeScript
12 lines
375 B
TypeScript
import { URI } from "vs/base/common/uri";
|
|
|
|
export const getPathFromAmdModule = (_: typeof require, relativePath: string): string => {
|
|
if (process.mainModule && process.mainModule.filename) {
|
|
const index = process.mainModule.filename.lastIndexOf("/");
|
|
|
|
return process.mainModule.filename.slice(0, index);
|
|
}
|
|
|
|
return relativePath ? URI.file(relativePath).fsPath : "";
|
|
};
|