Unable to scan for next token. Stuck on '
See original GitHub issueI’m using a .gitignore file, and I’m stuck on this error. The line on .gitignore file contains the value Generated\ Files/
Here are the code I’m using:
var directoryInfo = new DirectoryInfo(dir);
foreach (var line in File.ReadAllLines($@"{dir}\.gitignore", Encoding.UTF8))
{
try
{
var cleanLine = line.Trim();
if (string.IsNullOrEmpty(cleanLine) || cleanLine.Length == 0) continue; //Empty line
if (cleanLine.Substring(0, 1) == "#") continue;
if (cleanLine.Substring(0, 1) == "!")
{
cleanLine = cleanLine.Substring(1);
var infoAll = directoryInfo.GlobFileSystemInfos("**/*");
var infoIgnore = directoryInfo.GlobFileSystemInfos($"**/{cleanLine}");
ignore.AddRange(infoAll.Except(infoIgnore));
}
else
{
ignore.AddRange(directoryInfo.GlobFileSystemInfos($"**/{cleanLine}"));
}
}
catch (Exception e) { continue; };
}
and the .gitignore file can be obtained here
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Scanner error with nextInt() - java
The problem is you are called nextInt() which reads the next integer from the stream that the Scanner object points to, if there...
Read more >HELP!!!! I am stuck in a basic Scanner input program from ...
I am stuck in a basic Scanner input program from a book. I am following the code to the letter but it throws...
Read more >Java scanner.nextLine() Method Call Gets Skipped Error ...
It happens when you group together a bunch of input prompts and one of the scanner. nextLine() method calls gets skipped – without...
Read more >Why is Scanner skipping nextLine() after use of other next ...
This issue occurs because, when nextInt() method of Scanner class is used to read the age of the person, it returns the value...
Read more >Issues with Microsoft Purview Information Protection scanner
Underlying connection was closed; Stuck scanner processes; Unable to connect to remote server; Missing content scan job or profile ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks a lot, and take your time for doing it. I’m using Glob to make a backup tool using gitignore files for cleaning things.
This should be closed by 1.1.2 please let me know if you run into issues.