atom-community / atom-community/atom-script

issue. Scala. Folder names with spaces

Open
#1,233 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
730
Forks
264
PR merge metrics
No merged PRs in 30d

Description

The issue is, then I run Scala source it gives error "- was unexpected at this time."
And the reason for this is folder name **"OneDrive - name"** and more precise is middle part " - " (spaces and minus sign). It's a Scala issue.
To change folder name is not an option, OneDrive software not allowing it.
Solution is to put **""** (double quotes) around folder name. I can confirm what that helped me then I did run Scala code in the terminal.

Error: scalac -sourcepath E:\OneDrive - name\Scala\ hello.scala
Good: scalac -sourcepath E:\"OneDrive - name"\Scala\ hello.scala

Posible solution in JS:

```
function fixPath(oldPath){
var splited = path.split('\\');

for(var i = 0, len = splited.length; i < len; i++)
if( splited[i].includes(' '))
splited[i] = "\"" + splited[i] + "\"";

return splited.join('\\');
}

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.