working remote update uwu

This commit is contained in:
monty 2019-12-09 00:07:36 +01:00
parent abe9de3773
commit 2271bd86ba
2 changed files with 20 additions and 18 deletions

View file

@ -79,28 +79,30 @@ module.exports = (client) => {
});
});
app.get('/update', async (req, res) => {
if (req.headers.authorization !== 'Update') {
console.log(req.headers['user-agent']);
if (req.headers.authorization === 'Update') {
await exec('git pull')
.then((r) => {
console.log('Pulled latest changes');
res.status(200).jsonp({
success: true,
message: 'Successfully pulled latest changes'
});
//trying.edit('```fix\n' + r.stdout + '```');
})
.catch((error) => {
res.status(400).jsonp({
success: false,
message: error.message
});
console.error(error);
});
} else {
res.status(400).jsonp({
success: false,
message: 'You are not authorized to access this Endpoint'
});
}
await exec('git pull')
.then((r) => {
console.log('Pulled latest changes');
res.status(200).jsonp({
success: true,
message: 'Successfully pulled latest changes'
});
trying.edit('```fix\n' + r.stdout + '```');
})
.catch((error) => {
res.status(400).jsonp({
success: false,
message: error.message
});
console.error(error);
});
});
app.listen(port /* , hostname */, () => {

View file

@ -9,7 +9,7 @@
<divide></divide>
<div class="socials">
{{#each social}}
<a rel="me" href="https://{{link}}" class="{{name}}">x
<a rel="me" href="https://{{link}}" class="{{name}}">
<svg width="40" height="40" role="img" viewBox="0 0 24 24">
<title>{{name}} Icon</title>
<path d="{{icon.path}}"></path>