From 95d9fa1ad48b9e91a32bbe0e81df8981ea37f454 Mon Sep 17 00:00:00 2001 From: "Michael A. Sinclair" Date: Fri, 6 May 2022 08:53:03 -0500 Subject: [PATCH] fix: stop duplicate target error on unpack When merged, this will close #98. --- CHANGELOG.md | 10 ++++++++++ src/nasher.nim | 2 +- src/nasher/unpack.nim | 3 --- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ece383..809d915 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/src/nasher.nim b/src/nasher.nim index f826752..040c4fa 100644 --- a/src/nasher.nim +++ b/src/nasher.nim @@ -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) diff --git a/src/nasher/unpack.nim b/src/nasher/unpack.nim index f26d5c9..362724d 100644 --- a/src/nasher/unpack.nim +++ b/src/nasher/unpack.nim @@ -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