Archived
1
0

refactor: move tmpdir into src/node/constants

This commit is contained in:
Joe Previte
2021-04-21 13:22:11 -07:00
parent cc99fddf24
commit cb65590b98
8 changed files with 20 additions and 13 deletions

View File

@ -1,5 +1,6 @@
import { logger } from "@coder/logger"
import { JSONSchemaForNPMPackageJsonFiles } from "@schemastore/package"
import * as os from "os"
import * as path from "path"
export function getPackageJson(relativePath: string): JSONSchemaForNPMPackageJsonFiles {
@ -18,3 +19,4 @@ const pkg = getPackageJson("../../package.json")
export const version = pkg.version || "development"
export const commit = pkg.commit || "development"
export const rootPath = path.resolve(__dirname, "../..")
export const tmpdir = path.join(os.tmpdir(), "code-server")

View File

@ -4,7 +4,8 @@ import * as path from "path"
import * as tls from "tls"
import { Emitter } from "../common/emitter"
import { generateUuid } from "../common/util"
import { canConnect, tmpdir } from "./util"
import { tmpdir } from "./constants"
import { canConnect } from "./util"
/**
* Provides a way to proxy a TLS socket. Can be used when you need to pass a

View File

@ -8,8 +8,6 @@ import * as path from "path"
import * as util from "util"
import xdgBasedir from "xdg-basedir"
export const tmpdir = path.join(os.tmpdir(), "code-server")
interface Paths {
data: string
config: string