From 31c4e03534c24062101aaebf659e0a634e221a1b Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Sun, 29 Oct 2017 21:41:49 +0100 Subject: run #exec with cwd of sourcefile --- notyet | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/notyet b/notyet index f1b9249..712ccc2 100755 --- a/notyet +++ b/notyet @@ -144,10 +144,12 @@ def parse(io, filename=nil) if desc =~ /^#exec\s+(.+)/ # - error handling for #exec - IO.popen($1) { |f| - sub = parse(f, $1) - sub.reindent(i+2) - children = sub.children + Dir.chdir(File.dirname(fname)) { + IO.popen($1) { |f| + sub = parse(f, $1) + sub.reindent(i+2) + children = sub.children + } } next if children.empty? elsif desc =~ /^#include\s+(\S+)/ -- cgit 1.4.1