Skip to content

Commit

Permalink
fix: 文件名在 win 上取值错误
Browse files Browse the repository at this point in the history
  • Loading branch information
geekdada committed Oct 9, 2019
1 parent 7360c7b commit 310518b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/command/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Command from 'common-bin';
import fs from 'fs';
import dir from 'node-dir';
import ora, { Ora } from 'ora';
import path from "path";
import path from 'path';

import { loadConfig } from '../utils';

Expand Down Expand Up @@ -55,7 +55,7 @@ class GenerateCommand extends Command {
const { prefix } = config.upload;
const fileList = await dir.promiseFiles(config.output);
const files = fileList.map(filePath => ({
fileName: filePath.split('/').slice(-1)[0],
fileName: path.basename(filePath),
filePath,
}));
const fileNameList = files.map(file => file.fileName);
Expand Down

0 comments on commit 310518b

Please sign in to comment.