Skip to content

Commit 3ac2b20

Browse files
committed
Updated is arm check to be more accurate. Added missing schema validation for git resource
1 parent 96bbae9 commit 3ac2b20

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/resources/git/git/git-resource.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import { CreatePlan, DestroyPlan, Resource } from 'codify-plugin-lib';
1+
import { Resource } from 'codify-plugin-lib';
22
import { StringIndexedObject } from 'codify-schemas';
33

44
import { SpawnStatus, codifySpawn } from '../../../utils/codify-spawn.js';
55
import { GitEmailParameter } from './git-email-paramater.js';
66
import { GitNameParameter } from './git-name-parameter.js';
7+
import Schema from './git-schema.json';
78

89
export interface GitConfig extends StringIndexedObject {
910
email?: string,
@@ -19,6 +20,7 @@ export class GitResource extends Resource<GitConfig> {
1920
email: { statefulParameter: new GitEmailParameter(), },
2021
username: { statefulParameter: new GitNameParameter() },
2122
},
23+
schema: Schema,
2224
type: 'git'
2325
});
2426
}

src/utils/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ export const Utils = {
4747
},
4848

4949
async isArmArch(): Promise<boolean> {
50-
const query = await codifySpawn('uname -m');
51-
return query.data.includes('arm');
50+
const query = await codifySpawn('sysctl -n machdep.cpu.brand_string');
51+
return /M([0-9])/.test(query.data);
5252
},
5353

5454
async isDirectoryOnPath(directory: string): Promise<boolean> {

0 commit comments

Comments
 (0)