Comparing version 0.3.0 to 0.3.1
@@ -7,2 +7,3 @@ 'use strict'; | ||
const buildVersion = require('build-version'); | ||
const buildPath = require('build-path'); | ||
@@ -49,3 +50,6 @@ const realpath = (filePath) => { | ||
const linkPath = branch ? | ||
path.join('build', branch, 'latest') : | ||
buildPath({ | ||
branch, | ||
version : 'latest' | ||
}) : | ||
'latest-build'; | ||
@@ -52,0 +56,0 @@ |
{ | ||
"name": "build-data", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Get metadata for your build.", | ||
@@ -32,2 +32,3 @@ "homepage": "https://github.com/sholladay/build-data", | ||
"branch-name": "^0.1.4", | ||
"build-path": "^0.1.0", | ||
"build-version": "^0.2.0" | ||
@@ -34,0 +35,0 @@ }, |
@@ -25,3 +25,3 @@ # build-data [![Build status for build-data on Circle CI.](https://img.shields.io/circleci/project/sholladay/build-data/master.svg "Circle Build Status")](https://circleci.com/gh/sholladay/build-data "Build Data Builds") | ||
Get the current [branch name](https://github.com/sholladay/branch-name) and [build version](https://github.com/sholladay/build-version) to be associated with your build. | ||
Get the current [branch name](https://github.com/sholladay/branch-name) and a [version](https://github.com/sholladay/build-version) to be associated with your build. | ||
@@ -31,2 +31,6 @@ ```js | ||
console.log('data:', data); | ||
// { | ||
// branch : 'master', | ||
// version : '1.0.0' | ||
// } | ||
}); | ||
@@ -51,2 +55,56 @@ ``` | ||
## API | ||
### buildData(option) | ||
#### option | ||
Type: `object` | ||
Settings and known build metadata. | ||
##### cwd | ||
Type: `string`<br> | ||
Default: `process.cwd()` | ||
The parent directory of the build root. | ||
##### branch | ||
Type: `string` | ||
Use the given branch name, instead of asking git. | ||
##### version | ||
Type: `string` | ||
Use the given version, instead of asking [build-version](https://github.com/sholladay/build-version). | ||
### buildData.latest(option) | ||
Same as `buildData()`, except the `branch` defaults to the most recently built branch and `version` defaults to the most recently built version of the branch. | ||
### buildDir.link(option) | ||
Takes `cwd`, `branch`, and `version` on the option object. | ||
Within the `cwd`, writes a symlink at `latest-build` pointing to `build/<branch>/latest` and from there to `<version>`. | ||
### buildDir.prepare(option) | ||
Returns a promise for an object with these fields: | ||
- `path` is a newly created temporary directory for you to write the build to. | ||
- `finalize()` moves `path` to its final location and runs `buildDir.link()` on it. | ||
## Related | ||
- [build-version](https://github.com/sholladay/build-version) - Get a version for your build. | ||
- [build-dir](https://github.com/sholladay/build-dir) - Get a place to put your build. | ||
- [build-path](https://github.com/sholladay/build-path) - Get a path for the given build. | ||
- [build-keys](https://github.com/sholladay/build-keys) - Get the paths of files from your build. | ||
- [build-files](https://github.com/sholladay/build-files) - Read the files from your build. | ||
## Contributing | ||
@@ -53,0 +111,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22188
54
122
3
+ Addedbuild-path@^0.1.0
+ Addedbuild-path@0.1.1(transitive)