Philipp Kyeck
Philipp Kyeck

Reputation: 18860

vagrant + chef setup trying to git clone into synced folder

I have a synced folder in my vagrant setup

local.vm.synced_folder "../api", "/api"

and I want to be able to git clone another repository into this folder like this:

git "api" do
  destination "/api"
  repository "[email protected]:<user>/<repo>.git"
  revision "development"
  checkout_branch "development"
  action :sync
end

but I get an error saying:

==> local: STDERR: fatal: could not create work tree dir '/api'.: File exists

tried using another empty but already created folder /test and this worked.

Upvotes: 1

Views: 369

Answers (1)

garnertb
garnertb

Reputation: 9594

Change the destination to /api/<repo>. Your current code is changing the target of the clone to /api (the equivalent of git clone [email protected]:<user>/<repo>.git /api).

Upvotes: 2

Related Questions