mirror of
https://github.com/cupcakearmy/autorestic.git
synced 2025-09-06 10:30:39 +00:00
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
190eca6f6e | |||
805bed7db1 | |||
6c59aa25db | |||
ff648f0017 | |||
c79b45308b | |||
43eabdb204 | |||
0ead9e0da1 |
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
||||
*.afdesign filter=lfs diff=lfs merge=lfs -text
|
21
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
21
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
<!-- A clear and concise description of what the bug is. -->
|
||||
|
||||
**Expected behavior**
|
||||
<!-- A clear and concise description of what you expected to happen. -->
|
||||
|
||||
**Environment**
|
||||
- OS: [e.g. iOS]
|
||||
- Version: [e.g. 22]
|
||||
|
||||
**Additional context**
|
||||
<!-- Add any other context about the problem here. -->
|
4
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
4
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
contact_links:
|
||||
- name: Questions & Help
|
||||
url: https://github.com/cupcakearmy/autorestic/discussions
|
||||
about: Please ask and answer questions here.
|
14
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
14
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
|
||||
|
||||
**Describe the solution you'd like**
|
||||
<!-- A clear and concise description of what you want to happen. -->
|
BIN
.github/logo.afdesign
(Stored with Git LFS)
vendored
Normal file
BIN
.github/logo.afdesign
(Stored with Git LFS)
vendored
Normal file
Binary file not shown.
@@ -19,4 +19,4 @@ curl -s https://api.github.com/repos/cupcakearmy/autorestic/releases/latest \
|
||||
chmod +x ${OUT_FILE}
|
||||
|
||||
autorestic install
|
||||
autorestic
|
||||
autorestic --help
|
||||
|
@@ -1,11 +1,10 @@
|
||||
{
|
||||
"private": true,
|
||||
"version": "0.27",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"dev": "tsc -w",
|
||||
"move": "mv bin/index-linux bin/autorestic_linux_x64 && mv bin/index-macos bin/autorestic_macos_x64",
|
||||
"bin": "yarn run build && pkg dist/src/index.js --targets latest-macos-x64,latest-linux-x64 --out-path bin && yarn run move",
|
||||
"bin": "yarn run build && pkg dist/index.js --targets latest-macos-x64,latest-linux-x64 --out-path bin && yarn run move",
|
||||
"docs:build": "codedoc install && codedoc build",
|
||||
"docs:dev": "codedoc serve"
|
||||
},
|
||||
@@ -18,12 +17,14 @@
|
||||
"typescript": "^3.9"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/semver": "^7.3.4",
|
||||
"axios": "^0.19",
|
||||
"clitastic": "^0.1.2",
|
||||
"colors": "^1",
|
||||
"commander": "^6.2",
|
||||
"cron-parser": "2.x.x",
|
||||
"js-yaml": "3.x.x",
|
||||
"semver": "^7.3.5",
|
||||
"uhrwerk": "1.x.x"
|
||||
}
|
||||
}
|
||||
|
@@ -2,6 +2,7 @@ import { chmodSync } from 'fs'
|
||||
|
||||
import axios from 'axios'
|
||||
import { Writer } from 'clitastic'
|
||||
import semver from 'semver'
|
||||
|
||||
import { INSTALL_DIR, VERSION } from '..'
|
||||
import { checkIfResticIsAvailable, downloadFile, exec } from '../utils'
|
||||
@@ -18,19 +19,25 @@ export async function upgrade() {
|
||||
responseType: 'json',
|
||||
})
|
||||
|
||||
if (json.tag_name != VERSION) {
|
||||
const platformMap: { [key: string]: string } = {
|
||||
darwin: 'macos',
|
||||
const latest = semver.coerce(json.tag_name)
|
||||
const current = semver.coerce(VERSION)
|
||||
if (!latest || !current) throw new Error('Could not parse versions numbers.')
|
||||
if (semver.gt(latest, current) && semver.major(latest) === semver.major(current)) {
|
||||
// Update to compatible
|
||||
if (json.tag_name != VERSION) {
|
||||
const platformMap: { [key: string]: string } = {
|
||||
darwin: 'macos',
|
||||
}
|
||||
|
||||
const name = `autorestic_${platformMap[process.platform] || process.platform}_${process.arch}`
|
||||
const dl = json.assets.find((asset: any) => asset.name === name)
|
||||
|
||||
const to = INSTALL_DIR + '/autorestic'
|
||||
w.replaceLn('Downloading binary... 🌎')
|
||||
await downloadFile(dl.browser_download_url, to)
|
||||
|
||||
chmodSync(to, 0o755)
|
||||
}
|
||||
|
||||
const name = `autorestic_${platformMap[process.platform] || process.platform}_${process.arch}`
|
||||
const dl = json.assets.find((asset: any) => asset.name === name)
|
||||
|
||||
const to = INSTALL_DIR + '/autorestic'
|
||||
w.replaceLn('Downloading binary... 🌎')
|
||||
await downloadFile(dl.browser_download_url, to)
|
||||
|
||||
chmodSync(to, 0o755)
|
||||
}
|
||||
|
||||
w.done('All up to date! 🚀')
|
||||
|
@@ -5,7 +5,6 @@ import { setCIMode } from 'clitastic'
|
||||
import { unlock, readLock, writeLock, lock } from './lock'
|
||||
import { Config } from './types'
|
||||
import { init } from './config'
|
||||
import { version } from '../package.json'
|
||||
|
||||
import info from './handlers/info'
|
||||
import check from './handlers/check'
|
||||
@@ -18,7 +17,7 @@ import install from './handlers/install'
|
||||
import { uninstall } from './handlers/uninstall'
|
||||
import { upgrade } from './handlers/upgrade'
|
||||
|
||||
export const VERSION = version
|
||||
export const VERSION = '0.28'
|
||||
export const INSTALL_DIR = '/usr/local/bin'
|
||||
|
||||
let requireConfig: boolean = true
|
||||
|
@@ -9,5 +9,5 @@
|
||||
"alwaysStrict": true,
|
||||
"strictNullChecks": true
|
||||
},
|
||||
"include": ["./src", "./package.json"]
|
||||
"include": ["./src"]
|
||||
}
|
||||
|
Reference in New Issue
Block a user