/// <inheritdoc /> public override string ToRelativePathExpression(string path) { string drive = char.ToUpperInvariant(path[0]).ToString(); WriteMount(drive, drive); return(DScriptWriterUtils.EncloseInQuotes(DScriptWriterUtils.GetPathFromExpression(path), "'")); }
private string GetImportVariable(string specPath) { specPath = DScriptWriterUtils.GetPathFromExpression(specPath); // Check whether producer of variableName is the same file or not. if (DScriptWriterUtils.NormalizePath(AbsolutePath).EndsWith(specPath, StringComparison.Ordinal)) { return(string.Empty); } specPath = DScriptWriterUtils.RemoveFileEnding(specPath); string variableName; if (m_imports.TryGetValue(specPath, out variableName)) { // return null; return(variableName); } variableName = "P" + m_counter++; m_imports.Add(specPath, variableName); Writer.WriteLine("import * as {1} from '{0}.dsc';", DScriptWriterUtils.NormalizePath(specPath), variableName); return(variableName); }