-
Notifications
You must be signed in to change notification settings - Fork 238
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
Make output relative to tape file #121
Comments
I understand where you're coming from, but I wonder if that isn't less intuitive behavior 🤔 |
A new keyword definitely shouldn't be added without careful consideration, but what do you think about While it's definitely far more common for paths to be relative to the directory that the process is executed in, not the current file, many tools will have some way to get the file's directory ( I should note that my initial issue is actually that |
I'll note that, while checking out behavior, my initial assumption was that |
It isn't possible to get a relative output file if vhs gets input through Here are a few thoughts:
As for |
An $ cat file.tape
Output "out.gif"
...
$ vhs --out-dir /path/to/context file.tape
$ ls /path/to/context
out.gif ... This by itself wouldn't resolve the new tape not working out-of-the-box, but maybe that should be a separate issue. But maybe all of the examples could use |
By the way, interpreted languages like Ruby and JavaScript (Node) allow one to reference paths relative to the current file: require_relative '../path/to/file' require('../path/to/file') Both of these languages support interpretation from stdin AFAIK. Edit: Just to give further context to how other tools resolve relative paths, Node will interpret paths relative to the current file, but use the working directory if interpreting from stdin. For example $ echo "console.log('hello, world');" > greet.js
$ echo "require('../greet.js');" > subdir/index.js
$ node subdir/index.js
hello, world
$ node < subdir/index.js
(stacktrace)
$ cd subdir
$ node index.js
hello, world
$ node < index.js
hello, world |
Currently this usage would write to
demo/../subdir/tape.gif
instead ofdemo/subdir/tape.gif
, because it seems that the output is currently relative to the current directory, not the tape's directory.I thought this would be useful because I noticed the output of
vhs new demo.tape
doesn't work "out of the box", because theexamples/
directory must exist. If the output could be relative to the tape file, thenexamples/demo.tape
could use./demo.gif
, and the file would also work "out of the box" as the embedded output ofvhs new
. Making outputs relative to the tape would make results easier to reproducible.The text was updated successfully, but these errors were encountered: