Skip to content

Commit

Permalink
feat: add vendor id
Browse files Browse the repository at this point in the history
  • Loading branch information
sibiraj-s committed Nov 12, 2024
1 parent 2a6f8e6 commit 81fd993
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 0 deletions.
6 changes: 6 additions & 0 deletions create-typings.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ export const isPR: boolean | null;
* to use \`ci.TRAVIS\` instead.
*/
export const name: string | null;
/**
* Returns a string containing the identifier of the CI server the code is running on. If
* CI server is not detected, it returns \`null\`.
*/
export const id: string | null;
/* Vendor constants */
`

for (const { constant } of vendors) {
Expand Down
6 changes: 6 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ export const isPR: boolean | null;
* to use `ci.TRAVIS` instead.
*/
export const name: string | null;
/**
* Returns a string containing the identifier of the CI server the code is running on. If
* CI server is not detected, it returns `null`.
*/
export const id: string | null;

/* Vendor constants */
export const AGOLA: boolean;
export const APPCIRCLE: boolean;
export const APPVEYOR: boolean;
Expand Down
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Object.defineProperty(exports, '_vendors', {

exports.name = null
exports.isPR = null
exports.id = null

vendors.forEach(function (vendor) {
const envs = Array.isArray(vendor.env) ? vendor.env : [vendor.env]
Expand All @@ -28,6 +29,7 @@ vendors.forEach(function (vendor) {

exports.name = vendor.name
exports.isPR = checkPR(vendor)
exports.id = vendor.constant
})

exports.isCI = !!(
Expand Down
Loading

0 comments on commit 81fd993

Please sign in to comment.