emyl / vagrant-triggers

Allow the definition of arbitrary scripts that will run on the host before and/or after Vagrant commands.
MIT License
546 stars 35 forks source link

Not able to use commands with wildcards on arguments #58

Closed Restless-ET closed 6 years ago

Restless-ET commented 8 years ago

Hi there,

I'm not being able to execute commands containing a wildcard. For instance:

  config.trigger.after :halt do
    run "ls app/logs/"
  end

Works just fine... but:

  config.trigger.after :halt do
    run "ls app/logs/*"
  end

Does not work. I generates the following output:

==> default: Running triggers after halt...
==> default: Executing command "ls app/logs/*"...
==> default: /bin/ls: cannot access app/logs/*: No such file or directory
==> default: Command execution finished.
The command "ls app/logs/*" returned a failed exit code. The
error output is shown below:

/bin/ls: cannot access app/logs/*: No such file or directory

On the command line it works fine though.

Any ideas?

BTW, I'm using version 0.5.2

PS- I get the same error for the rm command as well.

deancsmith commented 8 years ago

I'm experiencing the same issue - I'm trying to copy some files between directories on the host but I just get a "cp: vagrant/hooks/*: No such file or directory" error.

config.trigger.after [:up, :resume, :reload] do
    run "cp vagrant/hooks/* .git/hooks/"
end

I'm running Vagrant 1.8.1 and vagrant-triggers 0.5.3.