-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Add --trackDir
option
#72
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -24,9 +24,6 @@ type | |||||||||||||
tests*: TrackExerciseTests | ||||||||||||||
repoExercise: TrackRepoExercise | ||||||||||||||
|
||||||||||||||
proc newTrackRepo: TrackRepo = | ||||||||||||||
result.dir = getCurrentDir() | ||||||||||||||
|
||||||||||||||
Comment on lines
-27
to
-29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I made this change partly because I find it more readable to inline it in But there's also a general issue that I'll try to fix everywhere eventually: I believe that procs that initialize non- From the style guide: https://nim-lang.github.io/Nim/nep1.html#introduction-naming-conventions
For example, in the stdlib But in my refactoring branch I think I changed a lot of this stuff to use |
||||||||||||||
proc configJsonFile(repo: TrackRepo): string = | ||||||||||||||
repo.dir / "config.json" | ||||||||||||||
|
||||||||||||||
|
@@ -83,5 +80,5 @@ proc findTrackExercises(repo: TrackRepo, conf: Conf): seq[TrackExercise] = | |||||||||||||
result.add(newTrackExercise(repoExercise)) | ||||||||||||||
|
||||||||||||||
proc findTrackExercises*(conf: Conf): seq[TrackExercise] = | ||||||||||||||
let trackRepo = newTrackRepo() | ||||||||||||||
let trackRepo = TrackRepo(dir: conf.trackDir) | ||||||||||||||
trackRepo.findTrackExercises(conf) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is
conf.trackDir
set to the current directory if the--track-dir
argument is not specified?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was set to the empty string, which ends up meaning the current directory.
From the examples in https://nim-lang.github.io/Nim/os.html#/,string,string
So
was the same as
when
trackDir
is empty.I pushed a new commit, do you prefer it?