Merge pull request #1930 from vitorgalvao/set-permissions-sudo
cask: staged: no sudo in set_permissions
This commit is contained in:
commit
b6f3399cb3
@ -27,7 +27,7 @@ module Hbc
|
|||||||
full_paths = remove_nonexistent(paths)
|
full_paths = remove_nonexistent(paths)
|
||||||
return if full_paths.empty?
|
return if full_paths.empty?
|
||||||
@command.run!("/bin/chmod", args: ["-R", "--", permissions_str] + full_paths,
|
@command.run!("/bin/chmod", args: ["-R", "--", permissions_str] + full_paths,
|
||||||
sudo: true)
|
sudo: false)
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_ownership(paths, user: current_user, group: "staff")
|
def set_ownership(paths, user: current_user, group: "staff")
|
||||||
|
|||||||
@ -47,7 +47,7 @@ shared_examples_for Hbc::Staged do
|
|||||||
staged.stubs(Pathname: fake_pathname)
|
staged.stubs(Pathname: fake_pathname)
|
||||||
|
|
||||||
Hbc::FakeSystemCommand.expects_command(
|
Hbc::FakeSystemCommand.expects_command(
|
||||||
["/usr/bin/sudo", "-E", "--", "/bin/chmod", "-R", "--", "777", fake_pathname]
|
["/bin/chmod", "-R", "--", "777", fake_pathname]
|
||||||
)
|
)
|
||||||
staged.set_permissions(fake_pathname.to_s, "777")
|
staged.set_permissions(fake_pathname.to_s, "777")
|
||||||
end
|
end
|
||||||
@ -57,7 +57,7 @@ shared_examples_for Hbc::Staged do
|
|||||||
staged.stubs(:Pathname).returns(fake_pathname)
|
staged.stubs(:Pathname).returns(fake_pathname)
|
||||||
|
|
||||||
Hbc::FakeSystemCommand.expects_command(
|
Hbc::FakeSystemCommand.expects_command(
|
||||||
["/usr/bin/sudo", "-E", "--", "/bin/chmod", "-R", "--", "777", fake_pathname, fake_pathname]
|
["/bin/chmod", "-R", "--", "777", fake_pathname, fake_pathname]
|
||||||
)
|
)
|
||||||
staged.set_permissions([fake_pathname.to_s, fake_pathname.to_s], "777")
|
staged.set_permissions([fake_pathname.to_s, fake_pathname.to_s], "777")
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user