Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: kernel fails on Windows #184

Merged
merged 1 commit into from
Aug 16, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/jsii-kernel/lib/kernel.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as fs from 'fs-extra';
import * as spec from 'jsii-spec';
import * as os from 'os';
import * as path from 'path';
import { SourceMapConsumer } from 'source-map';
import * as tar from 'tar';
Expand Down Expand Up @@ -73,7 +74,7 @@ export class Kernel {
}

if (!this.installDir) {
this.installDir = await fs.mkdtemp('/tmp/jsii-kernel-');
this.installDir = await fs.mkdtemp(path.join(os.tmpdir(), 'jsii-kernel-'));
await fs.mkdirp(path.join(this.installDir, 'node_modules'));
this._debug('creating jsii-kernel modules workdir:', this.installDir);

Expand Down Expand Up @@ -110,7 +111,7 @@ export class Kernel {
} else {
// untar the archive to a staging directory, read the jsii spec from it
// and then move it to the node_modules directory of the kernel.
const staging = await fs.mkdtemp('/tmp/jsii-kernel-install-staging-');
const staging = await fs.mkdtemp(path.join(os.tmpdir(), 'jsii-kernel-install-staging-'));
try {
await tar.extract({ strict: true, file: req.tarball, cwd: staging });

Expand Down