Skip to content

Commit

Permalink
Move package name to constants: DETECTION_RULES_PACAKGE_NAME
Browse files Browse the repository at this point in the history
  • Loading branch information
rw-access committed Feb 22, 2021
1 parent 4311ef4 commit b301d4a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

const DETECTION_RULES_PACAKGE_NAME = 'detection_rules';
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import {
} from '../../../../../fleet/server';

import { rawRules } from './prepackaged_rules';
import { DETECTION_RULES_PACAKGE_NAME } from './constants';

const DetectionRulesPackageName = 'detection_rules';
let latestRulesPackageVersion: string | undefined;
let latestRulesDownload: AddPrepackagedRulesSchemaDecoded[];
let usePackageRegistryRules = false;
Expand Down Expand Up @@ -96,7 +96,7 @@ export const getPackageRegistryRules = async (
return latestRulesDownload;
}

const { paths } = await getRegistryPackage(DetectionRulesPackageName, pkgVersion);
const { paths } = await getRegistryPackage(DETECTION_RULES_PACAKGE_NAME, pkgVersion);

const rulePaths = paths.filter(isRuleTemplate);
const rulePromises = rulePaths.map<AddPrepackagedRulesSchema>((path) => {
Expand Down

0 comments on commit b301d4a

Please sign in to comment.