Skip to content

When running under windows it fails in the RuntimeScalar.java #3

@gitterbitjc

Description

@gitterbitjc

Line: 1705
The below change fixes the issue in my local repo
fullName = Paths.get(resource.getPath().substring(resource.getPath().indexOf(":") + 2)); //Paths.get(resource.getPath());

Edited:

Looks like the code had changed a bit..

            String path = resource.getPath();
            // Remove leading slash if on Windows
            if (System.getProperty("os.name").toLowerCase().contains("win") && path.startsWith("/")) {
                path = path.substring(1);
            }
            fullName = Paths.get(path);

not sure if this new change fixes the previous issue at old-code:1705

also I added this:
if (fullName == null && code == null) {
GlobalContext.setGlobalVariable("main::!", "No such file or directory");
return new RuntimeScalar();
}

not sure if && code == null was necessary (forgot)

does this work on windows now..

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingquestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions