Skip to content

Add ability to configure working directory for unzipping/running node #369

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ x64/
_NCrunch_WebCompiler#Node

#Node
src/WebCompiler/Node/node_modules/*
src/WebCompiler/Node/node_modules/*
src/WebCompiler/Node/node.exe
9 changes: 8 additions & 1 deletion src/WebCompiler/Compile/CompilerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,19 @@ namespace WebCompiler
public static class CompilerService
{
internal const string Version = "1.4.167";
private static readonly string _path = Path.Combine(Path.GetTempPath(), "WebCompiler" + Version);
internal const string WorkingDirectoryEnvVarName = "WEBCOMPILER_WORKING_DIRECTORY";
private static readonly string _path = GetWorkingDirectoryPath();
private static object _syncRoot = new object(); // Used to lock on the initialize step

/// <summary>A list of allowed file extensions.</summary>
public static readonly string[] AllowedExtensions = new[] { ".LESS", ".SCSS", ".SASS", ".STYL", ".COFFEE", ".ICED", ".JS", ".JSX", ".ES6", ".HBS", ".HANDLEBARS" };

internal static string GetWorkingDirectoryPath()
{
var envValue = Environment.GetEnvironmentVariable(WorkingDirectoryEnvVarName);
return Path.Combine(envValue ?? Path.GetTempPath(), "WebCompiler" + Version);
}

/// <summary>
/// Test if a file type is supported by the compilers.
/// </summary>
Expand Down