Skip to content
This repository has been archived by the owner on Apr 30, 2019. It is now read-only.

Commit

Permalink
Merge pull request #11 from orgsync/improve-fstab-layout
Browse files Browse the repository at this point in the history
A few more tweaks to the /etc/fstab file
  • Loading branch information
Seth Vargo committed Jul 12, 2013
2 parents 3961df9 + 660f2a0 commit f1797c8
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions libraries/swapfile_provider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,8 @@ def persist
else
Chef::Log.info("#{@new_resource} adding entry to #{fstab} for #{@new_resource.path}")

contents << addition
contents.reject! { |line| line.strip.empty? }
::File.open(fstab, 'w') do |f|
f.write(contents.join("\n") + "\n")
end
contents << "#{addition}\n"
::File.open(fstab, 'w') { |f| f.write(contents.join('')) }
end
end

Expand Down

0 comments on commit f1797c8

Please sign in to comment.