Add rake task to update JSON schemas for github-pages
This commit is contained in:
parent
7a28db7d76
commit
473450c34a
1 changed files with 14 additions and 0 deletions
|
|
@ -6,6 +6,20 @@ task build: :test do
|
||||||
end
|
end
|
||||||
FileUtils.mkdir_p("pkg")
|
FileUtils.mkdir_p("pkg")
|
||||||
FileUtils.mv(Dir["*.gem"], "pkg")
|
FileUtils.mv(Dir["*.gem"], "pkg")
|
||||||
|
|
||||||
|
Rake::Task["update_json_schemas"].invoke
|
||||||
|
end
|
||||||
|
|
||||||
|
desc "Update JSON schemas for github-pages"
|
||||||
|
task :update_json_schemas do
|
||||||
|
git_clean = `git status --porcelain`.empty?
|
||||||
|
sh "git stash" unless git_clean
|
||||||
|
|
||||||
|
FileUtils.mkdir_p("docs/schemas")
|
||||||
|
FileUtils.cp(Dir["lib/diaspora_federation/schemas/*.json"], "docs/schemas")
|
||||||
|
|
||||||
|
sh "git add docs/schemas && git diff --staged --quiet || git commit -m 'Update JSON schemas for github-pages'"
|
||||||
|
sh "git stash pop" unless git_clean
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "Tags version, pushes to remote, and pushes gem"
|
desc "Tags version, pushes to remote, and pushes gem"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue