Skip to content

Commit 58162e7

Browse files
committed
fix: Disable import for git repository, fix import for macports install, allow pnpm to query the version
1 parent 1ae3054 commit 58162e7

4 files changed

Lines changed: 7 additions & 8 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "default",
3-
"version": "1.1.0-beta.4",
3+
"version": "1.1.0-beta.5",
44
"description": "Default plugin for Codify - provides 50+ declarative resources for managing development tools and system configuration across macOS and Linux",
55
"main": "dist/index.js",
66
"scripts": {

src/resources/git/repository/git-repository.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class GitRepositoryResource extends Resource<GitRepositoryConfig> {
5353
autoVerifySSH: { type: 'boolean', default: true, setting: true },
5454
},
5555
importAndDestroy: {
56-
requiredParameters: ['directory']
56+
preventImport: true,
5757
},
5858
allowMultiple: {
5959
matcher: (desired, current) => {

src/resources/javascript/pnpm/pnpm.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,12 @@ export class Pnpm extends Resource<PnpmConfig> {
4848
}
4949

5050
// Return a specific version if it's required from the user.
51-
if (parameters.version) {
51+
if (parameters.version || context.commandType === 'import') {
5252
const { data } = await pty.spawn('pnpm --version');
5353
return { version: data }
5454
}
5555

56-
return parameters;
57-
56+
return parameters;
5857
}
5958

6059
async create(plan: CreatePlan<PnpmConfig>): Promise<void> {

src/resources/macports/install-parameter.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ParameterSetting, Plan, StatefulParameter, getPty } from '@codifycli/plugin-core';
1+
import { ParameterSetting, Plan, SpawnStatus, StatefulParameter, getPty } from '@codifycli/plugin-core';
22

33
import { MacportsConfig } from './macports.js';
44

@@ -20,9 +20,9 @@ export class MacportsInstallParameter extends StatefulParameter<MacportsConfig,
2020

2121
async refresh(desired: Array<PortPackage | string> | null, config: Partial<MacportsConfig>): Promise<Array<PortPackage | string> | null> {
2222
const $ = getPty()
23-
const { data: installed } = await $.spawnSafe('port echo installed');
23+
const { data: installed, status } = await $.spawnSafe('port echo installed');
2424

25-
if (!installed || installed === '') {
25+
if (status === SpawnStatus.ERROR || !installed || installed === '' || installed.includes('Error:')) {
2626
return null;
2727
}
2828

0 commit comments

Comments
 (0)