@docupace/pipeline 1.0.5-alpha.21 → 1.0.5-alpha.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docupace/pipeline",
3
- "version": "1.0.5-alpha.21",
3
+ "version": "1.0.5-alpha.23",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -15,7 +15,19 @@ const program = new Command();
15
15
 
16
16
  const args = process.argv;
17
17
 
18
- const DIR = path.resolve(process.cwd());
18
+ async function createChangesetDirectory() {
19
+ try {
20
+ // Use path.join to build a safe path to `.changeset`
21
+ const targetDir = path.join(process.cwd(), '.changeset');
22
+
23
+ // Create the directory recursively if it doesn't exist
24
+ await fs.promises.mkdir(targetDir, { recursive: true });
25
+ console.log(`Directory created at ${targetDir}`);
26
+ } catch (error) {
27
+ console.error('Error creating .changeset directory:', error);
28
+ }
29
+ }
30
+
19
31
 
20
32
  function run(command) {
21
33
  return new Promise((resolve, reject) => {
@@ -255,7 +267,7 @@ ${summary} [${jiraTicketId}]
255
267
  `;
256
268
  const changesetFile = `./.changeset/${jiraTicketId}.md`;
257
269
 
258
- await run(`mkdir -p ./.changeset`);
270
+ await createChangesetDirectory();
259
271
  await fs.promises.writeFile(changesetFile, changesetContent);
260
272
  console.log(`Created changeset file at ${changesetFile}`);
261
273