(options: IDiskFactoryParams = {})
| 41 | }; |
| 42 | |
| 43 | const publish = async (options: IDiskFactoryParams = {}) => { |
| 44 | const projectToPublish = options.project || project; |
| 45 | if (!projectToPublish) { |
| 46 | throw new PublisherError('MissingProject'); |
| 47 | } |
| 48 | |
| 49 | const projectOutputPath = options.outputPath || outputPath; |
| 50 | const overrideProjectSlug = options.projectSlug || params.projectSlug; |
| 51 | const createProjectFolder = options.createProjectFolder ?? params.createProjectFolder; |
| 52 | |
| 53 | if (overrideProjectSlug) { |
| 54 | projectToPublish.name = overrideProjectSlug; |
| 55 | } |
| 56 | |
| 57 | try { |
| 58 | await writeFolder(projectToPublish, projectOutputPath, createProjectFolder, fs); |
| 59 | return { success: true, payload: projectOutputPath }; |
| 60 | } catch (error) { |
| 61 | throw new PublisherError(getErrorMessage(error) || 'UnknownError'); |
| 62 | } |
| 63 | }; |
| 64 | |
| 65 | return { |
| 66 | publish, |
nothing calls this directly
no test coverage detected
searching dependent graphs…