Skip to content

Commit

Permalink
Prohibit running Synx as root to avoid file permission issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
marklarr committed Dec 12, 2014
1 parent 1f42b40 commit abcec91
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bin/synx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ Clamp do
option ["--exclusion", "-e"], "EXCLUSION", "ignore an Xcode group while syncing", :multivalued => true

def execute
project = Synx::Project.open(xcodeproj_path)
project.sync(:prune => prune?, :quiet => quiet?, :no_color => no_color?, :no_default_exclusions => no_default_exclusions?, :group_exclusions => exclusion_list)
if Process.uid == 0
puts "You cannot run Synx as root.".red
else
project = Synx::Project.open(xcodeproj_path)
project.sync(:prune => prune?, :quiet => quiet?, :no_color => no_color?, :no_default_exclusions => no_default_exclusions?, :group_exclusions => exclusion_list)
end
end

end

0 comments on commit abcec91

Please sign in to comment.