Skip to content

Commit

Permalink
Fix firmware
Browse files Browse the repository at this point in the history
  • Loading branch information
jlkalberer committed Mar 4, 2024
1 parent 84d6d4b commit 9c876bf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions packages/spark-protocol/src/lib/FirmwareManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
ModuleSubDependency,
} from 'binary-version-reader';
import nullthrows from 'nullthrows';
import protocolSettings from '../settings';
import Logger from './logger';
const logger = Logger.createModuleLogger(module);
import { filterFalsyValues } from '../filterFalsyValues';
Expand All @@ -36,7 +35,10 @@ export type OTAUpdate = {

let FirmwareSettings: FirmwareSetting[] = [];
class FirmwareManager {
private static binariesDirectory: string;

static initialize(binariesDirectory: string): void {
FirmwareManager.binariesDirectory = binariesDirectory;
// eslint-disable-next-line import/no-dynamic-require, @typescript-eslint/no-var-requires
FirmwareSettings = require(
path.join(binariesDirectory, '../third-party/settings.json'),
Expand All @@ -59,7 +61,7 @@ class FirmwareManager {
}
const { systemFiles, ...result } = missingDependencies.reduce(
(acc, dependency) => {
const dependencyPath = `${protocolSettings.BINARIES_DIRECTORY}/${dependency.filename}`;
const dependencyPath = `${FirmwareManager.binariesDirectory}/${dependency.filename}`;

if (!fs.existsSync(dependencyPath)) {
logger.error(
Expand Down

0 comments on commit 9c876bf

Please sign in to comment.