lib/chef/provider/user/dscl.rb
#
# Sets the home directory for the user. If `:manage_home` is set home
# directory is managed (moved / created) for the user.
#
Sets the home directory for the user. If `:manage_home` is set home
directory is managed (moved / created) for the user.
Sets the home directory for the user . If ` : manage_home ` is set home directory is managed ( moved / created ) for the user .
def dscl_set_home
          if @new_resource.home.nil? || @new_resource.home.empty?
            run_dscl("delete /Users/#{@new_resource.username} NFSHomeDirectory")
            return
          end
          if @new_resource.supports[:manage_home]
            validate_home_dir_specification!
            if (@current_resource.home == @new_resource.home) && !new_home_exists?
              ditto_home
            elsif !current_home_exists? && !new_home_exists?
              ditto_home
            elsif current_home_exists?
              move_home
            end
          end
          run_dscl("create /Users/#{@new_resource.username} NFSHomeDirectory '#{@new_resource.home}'")
        end
def dscl_set_home if @new_resource . home . nil? || @new_resource . home . empty? run_dscl ( "delete /Users/#{@new_resource.username} NFSHomeDirectory" ) return end if @new_resource . supports [ :manage_home ] validate_home_dir_specification! if ( @current_resource . home == @new_resource . home ) && ! new_home_exists? ditto_home elsif ! current_home_exists? && ! new_home_exists? ditto_home elsif current_home_exists? move_home end end run_dscl ( "create /Users/#{@new_resource.username} NFSHomeDirectory '#{@new_resource.home}'" ) end
Sets the home directory for the user.
Sets the home directory for the user .