Sha256: fcf154ddca7538f2c501e2f3135960eb014172828ee2e6d3bf3256cb2355b269

Contents?: true

Size: 938 Bytes

Versions: 1

Compression:

Stored size: 938 Bytes

Contents

"use strict"

let version = process.argv[2]
let auth = process.argv[3]

if (!auth) {
  console.log("Usage: upload-release.js [TAG] [github-user:password]")
  process.exit(1)
}

require('child_process').exec("git --no-pager show -s --format='%s' " + version, (error, stdout) => {
  if (error) throw error
  let message = stdout.split("\n").slice(2)
  message = message.slice(0, message.indexOf("-----BEGIN PGP SIGNATURE-----")).join("\n")

  let req = require("https").request({
    host: "api.github.com",
    auth: auth,
    headers: {"user-agent": "Release uploader"},
    path: "/repos/codemirror/codemirror/releases",
    method: "POST"
  }, res => {
    if (res.statusCode >= 300) {
      console.error(res.statusMessage)
      res.on("data", d => console.log(d.toString()))
      res.on("end", process.exit(1))
    }
  })
  req.write(JSON.stringify({
    tag_name: version,
    name: version,
    body: message
  }))
  req.end()
})

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
stisla-rails-0.0.2 vendor/assets/modules/codemirror/bin/upload-release.js