14 lines
444 B
JavaScript
14 lines
444 B
JavaScript
|
|
import fs from 'fs';
|
||
|
|
import os from 'os';
|
||
|
|
import axios from 'axios';
|
||
|
|
|
||
|
|
const configPath = os.homedir() + '/.config/fjtui/fjtui.json';
|
||
|
|
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
||
|
|
|
||
|
|
axios.post(config.url + '/api/v1/repos/' + config.repo + '/issues', {
|
||
|
|
title: 'Second issue',
|
||
|
|
body: 'Body'
|
||
|
|
}, {
|
||
|
|
headers: { 'Authorization': 'token ' + config.token }
|
||
|
|
}).then(r => console.log('created')).catch(e => console.error(e.message));
|