Skip to content

Commit

Permalink
'update'
Browse files Browse the repository at this point in the history
  • Loading branch information
Allen-1998 committed May 9, 2022
1 parent 901a1bb commit dc998e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default function (options: Options = {}) {
Object.assign(options, defaultOptions)

const { storeDir, excludes, outputFile } = options as Required<Options>
const storePath = resolve(__dirname, storeDir)
const storePath = resolve(process.cwd(), storeDir)
const outputDir = outputFile.replace(/(\/[^/]*).ts/, '')
fs.readdir(outputDir).catch(() => fs.mkdir(outputDir))

Expand All @@ -28,7 +28,7 @@ export default function (options: Options = {}) {
.map((i) => i.replace('.ts', ''))
.filter((i) => !excludes.includes(i))

const ctx = `// auto import by 'pinia-auto-refs'
const ctx = `// "https://github.com/Allen-1998/pinia-auto-refs"
${storeNames.reduce(
(str, storeName) => `${str}import ${storeName}Store from '@/store/${storeName}'
`,
Expand Down

0 comments on commit dc998e4

Please sign in to comment.