It's not a false positive Jan, the `test` command returns exit status 1
which is a "failure to find this thing as a symlink"… we always walk the
boundary between an arguably sane language (Ruby) and some arcane weird old
Unix topics. You could try inverting the test (i.e I suceeded !finding the
thing as a symlink) and submit a PR if everything still works.

You're the 2nd person in about 12 months to ask about this, so whilst it
can certainly be confusing, I do think there's an element of valuable "why
is that failing… ohh it's just the way the underlying shell works"
education and knowledge sharing here.

Lee Hambley
http://lee.hambley.name/
+49 (0) 170 298 5667

On 26 March 2015 at 11:30, Jan Reges <[email protected]> wrote:

> Hi,
>
> I use latest Capistrano version 3.4.0.
>
> It's confusing for us, that Capistrano result shows red "failed" when
> testing symlinks existence before its creation.
>
> Expected result is - when there are no critical/unexpected issues, there
> are only "successful" messages. When somebody run deploy, these "failed"
> messages looks like an important failure.
>
> Do you have a simple/clean solution to this? Or I have to override whole
> task "linked_dirs" in my deploy.rb?
>
> Thank you.
>
> *EXAMPLE:*
>
> DEBUG [fb21d8fd] Running /usr/bin/env [ -L
> /www/PROJECT/releases/20150326101046/log/access-denied ] as
> [email protected]
> DEBUG [fb21d8fd] Command: [ -L
> /www/PROJECT/releases/20150326101046/log/access-denied ]
> DEBUG [fb21d8fd] Finished in 0.059 seconds with exit status 1 (failed).
>
> *CODE in deploy.rake:*
>
> task :linked_dirs do
>     next unless any? :linked_dirs
>     on release_roles :all do
>     execute :mkdir, '-p', linked_dir_parents(release_path)
>
>
>     fetch(:linked_dirs).each do |dir|
>         target = release_path.join(dir)
>         source = shared_path.join(dir)
>         unless test "[ -L #{target} ]"
>         if test "[ -d #{target} ]"
>           execute :rm, '-rf', target
>         end
>         execute :ln, '-s', source, target
>       end
>     end
>   end
> end
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/capistrano/cebef553-aa49-4a90-83dd-5ca72ed3ed2a%40googlegroups.com
> <https://groups.google.com/d/msgid/capistrano/cebef553-aa49-4a90-83dd-5ca72ed3ed2a%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/capistrano/CAN_%2BVLUcV%2B5P5nUbY5-dKKE-VdvUX1bjXkWbnUT7w9uupq3WzQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to