Skip to content

Commit

Permalink
wip: better windows support
Browse files Browse the repository at this point in the history
  • Loading branch information
ex3ndr committed Mar 8, 2023
1 parent 4c77823 commit ec0fa63
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export type CheckResult = {
export function check(args: { project: VirtualFileSystem, entrypoint: string }): CheckResult {

// Create context
let stdlib = createVirtualFileSystem('@stdlib', files);
let stdlib = createVirtualFileSystem('@stdlib/', files);
let ctx: CompilerContext = new CompilerContext({ shared: {} });
ctx = featureEnable(ctx, 'debug'); // Enable debug flag (does not affect type checking in practice)
ctx = featureEnable(ctx, 'masterchain'); // Enable masterchain flag to avoid masterchain-specific errors
Expand Down
2 changes: 1 addition & 1 deletion src/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export async function run(args: { configPath: string, projectNames?: string[] })
// Compile
let success = true;
let project = createNodeFileSystem(rootPath, false);
let stdlib = path.resolve(__dirname, '..', 'stdlib'); // Improves developer experience
let stdlib = path.resolve(__dirname, '..', 'stdlib') + path.sep; // Improves developer experience
for (let config of projects) {
console.log('💼 Compiling project ' + config.name + '...');
let built = await build({ config, project, stdlib, logger: consoleLogger });
Expand Down
5 changes: 1 addition & 4 deletions src/vfs/createVirtualFileSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ import { VirtualFileSystem } from "./VirtualFileSystem";

export function createVirtualFileSystem(root: string, fs: { [key: string]: string }, readonly: boolean = true): VirtualFileSystem {
let normalizedRoot = normalize(root);
if (!normalizedRoot.endsWith('/')) {
normalizedRoot += '/';
}
return {
root: normalizedRoot,
exists(filePath: string): boolean {
Expand All @@ -25,7 +22,7 @@ export function createVirtualFileSystem(root: string, fs: { [key: string]: strin
let name = filePath.slice(normalizedRoot.length);
let content = fs[name];
if (typeof content !== 'string') {
throw Error('File not found: ' + filePath);
throw Error(`File ${name} not found at ${filePath}`);
} else {
return Buffer.from(content, 'base64');
}
Expand Down

0 comments on commit ec0fa63

Please sign in to comment.