Skip to content

Commit

Permalink
Merge pull request #24 from adamjosefus/development
Browse files Browse the repository at this point in the history
Add variable
  • Loading branch information
adamjosefus authored Feb 22, 2022
2 parents 45dd563 + 45c4d62 commit b978cf3
Show file tree
Hide file tree
Showing 19 changed files with 677 additions and 278 deletions.
Binary file added .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
pkg.macos
pkg.exe
pkg.linux
Expand Down
75 changes: 59 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ A tool for managing the packages (repositories) on which your application depend
# Run directly
deno run pkg.ts --config=config.json

# Run directly from remote
deno run https://raw.githubusercontent.com/adamjosefus/pkg/main/pkg.ts --config=config.json

# Run bundled
deno run pkg.bundled.js --config=config.json

Expand All @@ -24,22 +27,6 @@ deno run pkg.bundled.js --config=config.json

```

## Config

```json
{
"https://github.com/adamjosefus/pkg.git": {
"dest": "../packages",
},
"<repo-reference>": {
"dest": "<path-to-dir>",
"branch": "<branch-or-tag>"
}
}
```

---


## Help

Expand Down Expand Up @@ -67,6 +54,62 @@ deno run pkg.ts --help
```


## Config

### Schema

```js
{
"destination": "<path-to-dir>", // optional
"variables": {
"<name>": "<value>",
"<name>": {
"from": "<path-to-file>"
}
}, // optional
"repositories": {
"<repo-reference>": {
"destination": "<path-to-dir>" // optional
"name": "<name>" // optional
"tag": "<tag>" // optional
"variables": {
"<name>": "<value>",
"<name>": {
"from": "<path-to-file>"
}
} // optional
}
}
}
```

### Example
```json
{
"destination": "./packages",
"variables": {
"ACCESS_TOKEN": {
"from": "./sercet.txt"
}
},
"repositories": {
"https://github.com/foo.git": [
{
"name": "Foo_v1",
"tag": "v1.0.0"
},
{
"name": "Foo_v2",
"tag": "v2.1.1"
}
],
"https://username:${ACCESS_TOKEN}@dev.azure.com/bar": {
"name": "Bar"
}
}
}
```

---


Expand Down
261 changes: 0 additions & 261 deletions lib/main.ts

This file was deleted.

Binary file added libs/.DS_Store
Binary file not shown.
File renamed without changes.
15 changes: 15 additions & 0 deletions libs/helpers/makeAbsolute.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* @copyright Copyright (c) 2022 Adam Josefus
*/


import { join, isAbsolute } from "https://deno.land/[email protected]/path/mod.ts";


export function makeAbsolute(root: string, path: string): string {
if (isAbsolute(path)) {
return path;
}

return join(root, path);
}
Loading

0 comments on commit b978cf3

Please sign in to comment.