1- import { PipelabContext , setupConfigFile , deleteConfigFile } from "@pipelab/core-node" ;
1+ import { PipelabContext , setupProjectsConfigFile , deletePipelineConfigFileByName } from "@pipelab/core-node" ;
22import { FileRepo , SaveLocation } from "@pipelab/shared" ;
33import { readFile , unlink , readdir } from "node:fs/promises" ;
44import { getDefaultUserDataPath } from "../paths" ;
@@ -9,7 +9,7 @@ export async function listPipelinesCommand(options: { userData?: string }) {
99 const context = new PipelabContext ( { userDataPath } ) ;
1010
1111 try {
12- const projectsConfig = await setupConfigFile < FileRepo > ( "projects" , { context } ) ;
12+ const projectsConfig = await setupProjectsConfigFile ( context ) ;
1313 const repo = await projectsConfig . getConfig ( ) ;
1414
1515 if ( ! repo . pipelines || repo . pipelines . length === 0 ) {
@@ -73,7 +73,7 @@ export async function showPipelineCommand(
7373 const context = new PipelabContext ( { userDataPath } ) ;
7474
7575 try {
76- const projectsConfig = await setupConfigFile < FileRepo > ( "projects" , { context } ) ;
76+ const projectsConfig = await setupProjectsConfigFile ( context ) ;
7777 const repo = await projectsConfig . getConfig ( ) ;
7878
7979 const pipeline = repo . pipelines ?. find (
@@ -217,7 +217,7 @@ export async function deletePipelineCommand(
217217 const context = new PipelabContext ( { userDataPath } ) ;
218218
219219 try {
220- const projectsConfig = await setupConfigFile < FileRepo > ( "projects" , { context } ) ;
220+ const projectsConfig = await setupProjectsConfigFile ( context ) ;
221221 const repo = await projectsConfig . getConfig ( ) ;
222222
223223 if ( ! repo . pipelines ) {
@@ -239,12 +239,10 @@ export async function deletePipelineCommand(
239239 // 1. Delete internal file if applicable
240240 if ( pipeline . type === "internal" ) {
241241 try {
242- await deleteConfigFile ( pipeline . configName , context ) ;
242+ await deletePipelineConfigFileByName ( pipeline . configName , context ) ;
243243 console . log ( `Deleted pipeline file: ${ pipeline . configName } .json` ) ;
244244 } catch ( e : any ) {
245- if ( e . code !== "ENOENT" ) {
246- console . warn ( `Warning: Could not delete pipeline file: ${ e . message } ` ) ;
247- }
245+ console . warn ( `Warning: Could not delete pipeline file: ${ e . message } ` ) ;
248246 }
249247 }
250248
0 commit comments