[git] First pass at a clean filter for Alfred workflows
diff --git a/.gitconfig b/.gitconfig
index cf07cc82..14ef8057 100644
--- a/.gitconfig
+++ b/.gitconfig
@@ -69,3 +69,5 @@
fetchJobs = 4
[commit]
verbose = true
+[filter "alfredworkflow"]
+ clean = clean_alfred_workflow
diff --git a/bin/clean_alfred_workflow b/bin/clean_alfred_workflow
new file mode 100755
index 00000000..83914cdf
--- /dev/null
+++ b/bin/clean_alfred_workflow
@@ -0,0 +1,13 @@
+#!/usr/bin/env ruby
+
+require 'rexml/document'
+
+doc = REXML::Document.new(ARGF.read, ignore_whitespace_nodes: :all)
+xpath = '//dict/key[text()="variablesdontexport"]/following-sibling::array'
+vars = doc.elements[xpath].map(&:text)
+
+vars.each do |var|
+ doc.elements["//key[text()='#{var}']/following-sibling::string"].text = ''
+end
+
+doc.write