Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔧 chore(changeset): fix paths for windows #1386

Merged
merged 2 commits into from
Apr 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions libs/nx/src/executors/create-changeset/executor.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import prompts from 'prompts'
import { readFile, rm, writeFile } from 'fs/promises'
import { join } from 'path'
import path, { join } from 'path'
import { promisify } from 'util'
import { exec } from 'child_process'
import { CreateChangesetExecutorSchema } from './schema'
Expand Down Expand Up @@ -94,7 +94,8 @@ export default async function runExecutor(options: CreateChangesetExecutorSchema

// create new changeset file
const { stdout } = await promisify(exec)(`npx changeset add --empty`)
const start = stdout.lastIndexOf('.changeset/') + '.changeset/'.length
const triggerWord = '.changeset' + path.sep
const start = stdout.lastIndexOf(triggerWord) + triggerWord.length
const end = stdout.lastIndexOf('.md') + '.md'.length
const filename = stdout.substring(start, end).trim()
const filepath = join(options.workspaceRoot, '.changeset', filename)
Expand Down