Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions cli/commands.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict'
import * as fs from 'node:fs/promises';
import { homedir } from 'node:os';
import { dirname, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import { styleText } from 'node:util';
Expand All @@ -13,7 +12,7 @@ import { validateDirname } from './utils/validate-dirname.mjs';
export const __dirname = dirname(fileURLToPath(import.meta.url));
export const packageJsonPath = resolve(__dirname, '..', 'package.json');
export const packageJson = JSON.parse(await fs.readFile(packageJsonPath, 'utf-8'));
const defaultOutput = resolve(homedir(), 'Downloads', '.cursor');
const defaultOutput = process.cwd();

/** @returns {void} */
export const help = () => {
Expand Down
4 changes: 2 additions & 2 deletions cli/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ async function main() {
await interactiveMode(values);
process.exit(0);
case 'output':
const outputDir = values[key]?.toString() ?? defaultCursorPath;
const outputDir = values[key]?.toString() ?? process.cwd();
await output(outputDir);
break;
case 'flat':
const cursorRulesPath = process.env.npm_config_prefix?.toString() ?? `${defaultCursorPath}/rules`;
const cursorRulesPath = process.cwd();
await downloadFiles(cursorRulesPath);
break;
}
Expand Down
4 changes: 2 additions & 2 deletions cli/utils/download-files.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ export const downloadSelectedFiles = async (folderName, selectedRules) => {
try {
// Create output directory structure
await mkdir(outputDir, { recursive: true });
await mkdir(join(outputDir, 'rules'), { recursive: true });
await mkdir(join(outputDir, '.cursor'), { recursive: true });

// Copy selected rules
for (const rule of selectedRules) {
const sourcePath = join(sourceRulesBasePath, rule.path);
const destPath = join(outputDir, 'rules', rule.path);
const destPath = join(outputDir, '.cursor', 'rules', rule.path);
const destDir = dirname(destPath);

// Ensure destination directory exists
Expand Down
Loading