Skip to content

Commit e133179

Browse files
committed
fix(icons-cli): output dir path
1 parent 1636c45 commit e133179

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

.github/workflows/icons.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77
workflow_dispatch:
88

99
env:
10-
OUTPUT_ROOT_DIR: packages/icon-files/
1110
TARGET_BRANCH: ${{ github.event_name == 'workflow_dispatch' && github.ref_name || 'main' }}
1211

1312
jobs:
@@ -37,12 +36,17 @@ jobs:
3736
env:
3837
FIGMA_FILE_URL: ${{ secrets.FIGMA_FILE_URL }}
3938
FIGMA_TOKEN: ${{ secrets.FIGMA_TOKEN }}
39+
OUTPUT_ROOT_DIR: ../icon-files/
4040
run: pnpm --filter @charcoal-ui/icons-cli cli:icons figma:export
4141

4242
- name: Optimize icons
43+
env:
44+
OUTPUT_ROOT_DIR: ../icon-files/
4345
run: pnpm --filter @charcoal-ui/icons-cli cli:icons svg:optimize --ignoreFile ../../misc/icons-cli-denylist
4446

4547
- name: Generate icon files
48+
env:
49+
OUTPUT_ROOT_DIR: ../icon-files/
4650
run: pnpm --filter @charcoal-ui/icons-cli cli:icons files:generate
4751

4852
- name: Generate github token
@@ -52,10 +56,15 @@ jobs:
5256
app_id: ${{ secrets.CHARCOAL_BOT_APP_ID }}
5357
private_key: ${{ secrets.CHARCOAL_BOT_PRIVATE_KEY }}
5458

59+
- run: |
60+
pwd
61+
ls -al packages/icon-files
62+
5563
- name: Create Pull Request for updated icons
5664
env:
5765
GITHUB_ACCESS_TOKEN: ${{ steps.generate_token.outputs.token }}
5866
GITHUB_REPO_OWNER: pixiv
5967
GITHUB_REPO_NAME: charcoal
6068
GITHUB_DEFAULT_BRANCH: ${{ env.TARGET_BRANCH }}
69+
OUTPUT_ROOT_DIR: ../icon-files/
6170
run: pnpm --filter @charcoal-ui/icons-cli cli:icons github:pr

packages/icons-cli/src/GitHubClient.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ export class GithubClient {
2929
) {
3030
const client = new this(repoOwner, repoName, token, defaultBranch)
3131
const outputDirFullPath = path.resolve(process.cwd(), outputDir)
32+
// eslint-disable-next-line no-console
33+
console.log(outputDirFullPath)
3234
const diff = await client.createTreeFromDiff(outputDirFullPath)
3335
// eslint-disable-next-line no-console
3436
console.log(`${diff.length} files are changed`)

packages/icons-cli/src/figma/FigmaFileClient.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ export class FigmaFileClient {
5858

5959
const outputDir = path.join(process.cwd(), outputRootDir, exportFormat)
6060

61+
// eslint-disable-next-line no-console
62+
console.log(`output dir: ${outputDir}`)
6163
// eslint-disable-next-line no-console
6264
console.log(`Exporting components from ${url}`)
6365
await client.loadSvg(outputDir)

packages/icons-cli/src/generateSource.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const generateEntrypoint = async (
4646
outputDir: string,
4747
icons: string[]
4848
) => {
49-
const srcRoot = path.join(outputDir, 'src')
49+
const srcRoot = path.join(process.cwd(), outputDir, 'src')
5050
const mjsPath = path.join(srcRoot, 'index.js')
5151
await fs.ensureFile(mjsPath)
5252
await fs.writeFile(mjsPath, generateMjsEntrypoint(icons))
@@ -61,8 +61,11 @@ export const generateEntrypoint = async (
6161
}
6262

6363
export const generateIconSource = async (outputDir: string) => {
64-
const svgRoot = path.join(outputDir, 'svg')
65-
const srcRoot = path.join(outputDir, 'src')
64+
const svgRoot = path.join(process.cwd(), outputDir, 'svg')
65+
const srcRoot = path.join(process.cwd(), outputDir, 'src')
66+
67+
// eslint-disable-next-line no-console
68+
console.log(`output dir: ${srcRoot}`)
6669
const icons = (await glob('**/*.svg', { cwd: svgRoot }))
6770
.map(
6871
(path) => path.slice(0, -4) // e.g. '16/Add.svg' -> '16/Add'

0 commit comments

Comments
 (0)