question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to scan for next token. Stuck on '

See original GitHub issue

I’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:closed
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
felipecdscommented, Jan 4, 2019

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.

0reactions
kthompsoncommented, Mar 14, 2019

This should be closed by 1.1.2 please let me know if you run into issues.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found