Skip to content

Commit

Permalink
fix: stop duplicate target error on unpack
Browse files Browse the repository at this point in the history
When merged, this will close #98.
  • Loading branch information
squattingmonk committed May 6, 2022
1 parent c668840 commit 95d9fa1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# nasher changelog

## 0.17.3: May 6, 2022

`unpack` no longer causes a duplicate target error.
([#98](https://github.com/squattingmonk/nasher/issues/98))

---

Details: https://github.com/squattingmonk/nasher/compare/0.17.2...0.17.3


## 0.17.2: April 21, 2022

- An error is now generated if multiple targets in nasher.cfg have the same name.
Expand Down
2 changes: 1 addition & 1 deletion src/nasher.nim
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ when isMainModule:
of "config":
config(opts)
of "init":
if init(opts, pkg):
if init(opts, pkg) and loadPackageFile(pkg, getPackageFile()):
unpack(opts, pkg)
of "unpack":
unpack(opts, pkg)
Expand Down
3 changes: 0 additions & 3 deletions src/nasher/unpack.nim
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,6 @@ proc unpack*(opts: Options, pkg: PackageRef) =
if not dirExists(dir):
fatal("Cannot unpack to {dir}: directory does not exist.")

if not loadPackageFile(pkg, getPackageFile(dir)):
fatal(dir & " is not a nasher project. Please run nasher init.")

# If the user has specified a file to unpack, use that. Otherwise, look for
# the installed target file.
let
Expand Down

0 comments on commit 95d9fa1

Please sign in to comment.