Skip to content
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

Script to forward commands/arguments from host to guest and back #8

Open
readbeyond opened this issue May 13, 2017 · 1 comment
Open

Comments

@readbeyond
Copy link
Owner

From readbeyond/aeneas#176 (comment) :

Just an idea, maybe not a good one: you could make python 'stubs' for the aeneas commands that live in the aeneas-vagrant folder. These would only forward the arguments to the real aeneas commands in the VM via 'vagrant ssh -c.' I think 'vagrant ssh -c' is not set up to print stderr to the terminal from the VM child process, only stdin. Not quite sure though. Like this, it's really almost like having aeneas installed natively.. I had difficulties installed aeneas natively on ubuntu 16.04 (such issues are understandable). Although, it's probably confusing for the user that they can't specify input files outside of the aeneas-vagrant folder. Ah, forget it. If I have a better idea I'll let you know. :-)

@readbeyond
Copy link
Owner Author

readbeyond commented May 13, 2017

I was not aware that vagrant ssh supports the -c option. (I do not use the Vagrant image myself.) That is quite interesting, thank you.

I am not sure if I understand correctly your suggestion, though.

What I understood is that you would like to be able to run, in the host OS, something like:

$ vagrant_aeneas_task audio.mp3 text.txt "..." out.srt

and vagrant_aeneas_task should basically run vagrant ssh -c, passing the other command line parameters. If this is what you want, then it can be done with a simple bash script, like this:

#!/bin/bash

# check on the number of parameters, omitted here...

# the paths should be actually expressed relative to the shared directory
AUDIO=$1
TEXT=$2
CONF=$3
OUT=$4

# maybe we want to pass other parameters (-l -r="..." etc) as well...

vagrant ssh -c "python -m aeneas.tools.execute_task /vagrant/$AUDIO /vagrant/$TEXT $CONF /vagrant/$OUT"

Does this make sense?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant