mirror of
https://bitbucket.org/minetest_gamers/x_enchanting.git
synced 2025-06-30 23:00:24 +02:00
Add content, assets, scripts, sounds
This commit is contained in:
32
scripts/deploy.js
Normal file
32
scripts/deploy.js
Normal file
@ -0,0 +1,32 @@
|
||||
import fetch from 'node-fetch'
|
||||
import yargs from 'yargs/yargs'
|
||||
import {hideBin} from 'yargs/helpers'
|
||||
|
||||
const argv = yargs(hideBin(process.argv)).argv
|
||||
|
||||
try {
|
||||
const body = {
|
||||
method: 'git',
|
||||
title: argv.title,
|
||||
ref: 'master'
|
||||
}
|
||||
|
||||
const response = await fetch('https://content.minetest.net/api/packages/SaKeL/x_enchanting/releases/new/', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(body),
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: `Bearer ${argv.token}`
|
||||
}
|
||||
})
|
||||
const data = await response.json()
|
||||
|
||||
console.log(data)
|
||||
|
||||
if (!data.success) {
|
||||
process.exit(1)
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
process.exit(1)
|
||||
}
|
Reference in New Issue
Block a user