editor icon indicating copy to clipboard operation
editor copied to clipboard

Use tmpdir instead of __textlint_compier_temp

Open azu opened this issue 4 years ago • 1 comments

https://github.com/textlint/editor/blob/630fd1ee938a2b39e8ae74afdbde157497125557/packages/%40textlint/script-compiler/src/compiler.ts#L178 Instead of it, use actual tmp.dir()

azu avatar May 15 '21 12:05 azu

Fmm, if we use const tempDir = await fs.promises.mkdtemp(path.join(os.tmpdir(), "__textlint_compier_temp"));, script-compiler throw following error.

[
  {
    moduleIdentifier: '/private/var/folders/h1/vcv_f7n53sx_tfs4qmlrqft80000gp/T/__textlint_compier_temp5QRLTX/input.js',
    moduleName: '../../../../../../../../private/var/folders/h1/vcv_f7n53sx_tfs4qmlrqft80000gp/T/__textlint_compier_temp5QRLTX/input.js',
    loc: '2:0-50',
    message: "Module not found: Error: Can't resolve '@textlint/kernel' in '/private/var/folders/h1/vcv_f7n53sx_tfs4qmlrqft80000gp/T/__textlint_compier_temp5QRLTX'",
    moduleId: 64,

azu avatar Oct 07 '21 14:10 azu