Skip to content

Commit

Permalink
Fix absolute path for -f and update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
zyedidia committed Sep 1, 2023
1 parent d09eefd commit 57ee7bf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ Lua. If you are familiar with Make, you can learn Knit very quickly.
Knit tracks more of your build to give you better incremental builds. For
example, Knit automatically adds an implicit dependency on a rule's recipe, so
if you change a recipe (either directly or through a variable change), Knit
will automatically re-run all rules that were affected.
will automatically re-run all rules that were affected. Knit will also skip
build steps dynamically if it can determine that they will be unchanged from
the previous run (even if earlier dependencies were changed).

Knit has support for namespaced sub-builds that execute relative to their
directory, but Knit avoids build fragmentation because sub-builds don't rely on
Expand All @@ -32,8 +34,11 @@ will be useful to you too. Everyone hates something about their build system so
if you have feedback or a request, let me know! The project is new enough that
your feedback may be seriously taken into account.

I have written an article with more details about Knit
[here](https://zyedidia.github.io/blog/posts/3-knit-better-make/).
**Articles**: I have written two articles with more details about Knit
[here](https://zyedidia.github.io/blog/posts/3-knit-better-make/) and
[here](https://zyedidia.github.io/blog/posts/4-incremental-d-knit/) (this
article is specifically about D, but the optimization Knit applies is general
and not tied to D specifically).

# Features

Expand Down
8 changes: 8 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ func DefaultBuildFile() (string, bool) {
}

func FindBuildFile(name string) (string, string, error) {
if filepath.IsAbs(name) {
if existsFile(name) {
return name, filepath.Dir(name), nil
} else {
return "", "", errors.New("does not exist")
}
}

wd, err := os.Getwd()
if err != nil {
return "", "", err
Expand Down

0 comments on commit 57ee7bf

Please sign in to comment.