mirror of
https://github.com/ful1e5/apple_cursor.git
synced 2025-05-15 23:54:44 -04:00
🧰 get output path util
This commit is contained in:
parent
687a5f97e2
commit
7abad3d8d1
2 changed files with 13 additions and 7 deletions
|
@ -1,7 +0,0 @@
|
||||||
export const getFrameNumber = (number: number, length: number) => {
|
|
||||||
var str = "" + number;
|
|
||||||
while (str.length < length) {
|
|
||||||
str = "0" + str;
|
|
||||||
}
|
|
||||||
return str;
|
|
||||||
};
|
|
13
src/utils/getOutPath.ts
Normal file
13
src/utils/getOutPath.ts
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
import path from "path";
|
||||||
|
import { bitmapsDir } from "../config";
|
||||||
|
|
||||||
|
export const getOutPath = (number: number, length: number, svgFile: string) => {
|
||||||
|
let frame = "" + number;
|
||||||
|
while (frame.length < length) {
|
||||||
|
frame = "0" + frame;
|
||||||
|
}
|
||||||
|
|
||||||
|
const bitmap = `${path.basename(svgFile, ".svg")}-${frame}.png`;
|
||||||
|
|
||||||
|
return path.resolve(bitmapsDir, bitmap);
|
||||||
|
};
|
Loading…
Add table
Add a link
Reference in a new issue