Play

Check-in [b5bd5c4ee0]
Login
Overview
Comment:Find path to stdlib and pass that on to PackageLoader.elm.
Timelines: family | ancestors | descendants | both | cli
Files: files | file ages | folders
SHA3-256: b5bd5c4ee0e8e304c16cf5a4ddfdc7678d1bc1c5df61fd935613af142cf856f1
User & Date: robin.hansen on 2021-04-07 07:42:14
Other Links: branch diff | manifest | tags
Context
2021-04-07
08:01
Add cli command for initializing project. check-in: 770b0da167 user: robin.hansen tags: cli
07:42
Find path to stdlib and pass that on to PackageLoader.elm. check-in: b5bd5c4ee0 user: robin.hansen tags: cli
07:30
Check for existance of 'play.json' before initializing Elm-based compiler. check-in: 81e0c6f0c7 user: robin.hansen tags: cli
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Modified bin/cli.js from [af15a6b2e4] to [6508b8f3bf].

1
2
3
4
5
6

7
8
9
10
11
12
13
..
29
30
31
32
33
34
35
36

37
38
39
40
41
42
43
#!/usr/bin/env node

const path = require("path");
const fs = require("fs");
const wabtInit = require("wabt");


const subCmd = process.argv[2];
const subCmdFlags = process.argv.slice(3);

switch (subCmd) {
    case "compile": compileProject(); break;
    case "run": runProject(); break;
    default: printHelp(); break;
................................................................................
        console.error("No 'play.json' file found in this directory.");
        return;
    }

    const compiler = require(__dirname + "/compiler").Elm.CLI.init({
        flags: {
            projectDir: cwd,
            entryPoint: typeof entryPoint === "undefined" ? null : entryPoint

        }
    });

    compiler.ports.outgoingPort.subscribe((msg) => {
        switch (msg.type) {
            case 'readFile':
                const filePath = path.join(msg.path, msg.fileName);






>







 







|
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
..
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env node

const path = require("path");
const fs = require("fs");
const wabtInit = require("wabt");

const stdLibPath = path.resolve(__dirname, "..", "stdlib");
const subCmd = process.argv[2];
const subCmdFlags = process.argv.slice(3);

switch (subCmd) {
    case "compile": compileProject(); break;
    case "run": runProject(); break;
    default: printHelp(); break;
................................................................................
        console.error("No 'play.json' file found in this directory.");
        return;
    }

    const compiler = require(__dirname + "/compiler").Elm.CLI.init({
        flags: {
            projectDir: cwd,
            entryPoint: typeof entryPoint === "undefined" ? null : entryPoint,
            stdLibPath: stdLibPath
        }
    });

    compiler.ports.outgoingPort.subscribe((msg) => {
        switch (msg.type) {
            case 'readFile':
                const filePath = path.join(msg.path, msg.fileName);