Skip to content

Instantly share code, notes, and snippets.

@ekohl
Created November 25, 2020 16:05
Show Gist options
  • Save ekohl/7bb4d0dfc5226d6e62d5b25737b8baee to your computer and use it in GitHub Desktop.
Save ekohl/7bb4d0dfc5226d6e62d5b25737b8baee to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'yaml'
filenames = ARGV
filenames.each do |filename|
msync = YAML.safe_load(File.read(filename)).reject{ |k,v| k == '.travis.yml' }
if msync.any?
File.write(filename, YAML.dump(msync))
else
File.unlink(filename)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment