Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge commit '9182216e3be5d558cf0a74b85a1953c78780eb0f' into HEAD

  • Loading branch information...
commit 30d669da219eda35d9431e4b1e04814ca9a47fe0 2 parents 7626a41 + 9182216
Jenkins authored
Showing with 21 additions and 0 deletions.
  1. +21 −0 script/cross_reference_ids.rb
View
21 script/cross_reference_ids.rb
@@ -0,0 +1,21 @@
+unless defined? Rails
+ $stderr.puts "Run me with script/rails r #$0 < export.json"
+ exit 1
+end
+
+export = JSON.parse($stdin.read)
+
+old_to_new = {}
+
+export["artefacts"].each do |a|
+ slug = a["slug"]
+ old_id = a["id"]
+ artefact = Artefact.where(slug: slug).first
+ if artefact
+ old_to_new[old_id] = artefact._id.to_s
+ else
+ $stderr.puts "Could not find #{slug}"
+ end
+end
+
+puts JSON.dump(old_to_new)
Please sign in to comment.
Something went wrong with that request. Please try again.