Skip to content

Commit 44c884f

Browse files
authored
Merge pull request #2 from gitopia/add-readme
Add readme
2 parents 056d36e + 4765765 commit 44c884f

7 files changed

Lines changed: 49 additions & 8 deletions

File tree

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: gitopia mirror
1+
name: Gitopia mirror
22

33
on:
44
push:
@@ -14,10 +14,10 @@ jobs:
1414
with:
1515
node-version: 12
1616
registry-url: https://registry.npmjs.org/
17-
- name: gitopia mirror action
17+
- name: Gitopia mirror action
1818
uses: gitopia/gitopia-mirror-action@master
1919
# The action should not publish any real changes, but should succeed.
2020
with:
2121
gitopiaWallet: "${{ secrets.GITOPIA_WALLET }}"
2222
branch: "master"
23-
remoteUrl: "gitopia://7yFP2o906A3nDl5eCMtN4Ycs9m5otfRrJDAGoGKDoHk/git-remote-gitopia"
23+
remoteUrl: "gitopia://jf9rQRuE_TnKi5stRHbGk8pjtVKQ_0ikFs8tfYyZLMs/git-remote-gitopia"

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Gitopia
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# git-remote-gitopia
2+
3+
git remote helper for [Gitopia](https://gitopia.org)
4+
PST Fee of 0.01 AR is applicable on git push.
5+
6+
## Steps to Build
7+
8+
- `npm install`
9+
- `npm link`
10+
11+
## Usage
12+
13+
Set the following environment variable with the path of your Arweave wallet file.
14+
`export GITOPIA_WALLET_PATH=/path/to/wallet`
15+
16+
You don't need to run `git-remote-gitopia` directly, it will be called automatically by `git` when it encounters remote of the form `gitopia://`

bin/helper.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import ArweaveBundles from "arweave-bundles";
2323
import pkg from "cli-progress";
2424
const { SingleBar, Presets } = pkg;
2525

26-
export const VERSION = "0.1.4"
26+
export const VERSION = "0.1.5"
2727

2828
const _timeout = async (duration) => {
2929
return new Promise((resolve, reject) => {
@@ -277,6 +277,10 @@ export default class Helper {
277277
.slice(0, -1)
278278
.map((object) => object.substr(0, 40));
279279

280+
if (objects.length === 0) {
281+
this._exit()
282+
}
283+
280284
// checking permissions
281285
try {
282286
spinner = ora(`Checking permissions over ${this.address}`).start();

bin/lib/graphql.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ export const getOidByRef = async (arweave, remoteURI, ref) => {
1414
transactions(
1515
owners: ["${repoOwnerAddress}"]
1616
tags: [
17+
{ name: "Type", values: ["update-ref"] }
1718
{ name: "Repo", values: ["${repoName}"] }
1819
{ name: "Version", values: ["0.0.2"] }
1920
{ name: "Ref", values: ["${ref}"] }
20-
{ name: "Type", values: ["update-ref"] }
2121
{ name: "App-Name", values: ["gitopia"] }
2222
]
2323
first: 10
@@ -78,9 +78,9 @@ export const getAllRefs = async (arweave, remoteURI) => {
7878
transactions(
7979
owners: ["${repoOwnerAddress}"]
8080
tags: [
81+
{ name: "Type", values: ["update-ref"] }
8182
{ name: "Repo", values: ["${repoName}"] }
8283
{ name: "Version", values: ["0.0.2"] }
83-
{ name: "Type", values: ["update-ref"] }
8484
{ name: "App-Name", values: ["gitopia"] }
8585
]
8686
) {

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gitopia/git-remote-gitopia",
3-
"version": "0.1.4",
3+
"version": "0.1.5",
44
"description": "git-remote-helper for Gitopia",
55
"main": "bin/index.mjs",
66
"bin": {

0 commit comments

Comments
 (0)