mirror of
https://github.com/tiktok/sparo.git
synced 2024-11-14 19:35:12 -05:00
Merge pull request #46 from L-Qun/main
chore: use path.parse instead of split
This commit is contained in:
commit
34737f5fd5
2 changed files with 12 additions and 6 deletions
|
@ -107,12 +107,8 @@ export class SparoProfileService {
|
|||
}
|
||||
|
||||
private static _getProfileName(profilePath: string): string {
|
||||
const pathArr: string[] = profilePath.split(path.sep);
|
||||
const last: string = pathArr[pathArr.length - 1];
|
||||
if (last.endsWith('.json')) {
|
||||
return last.slice(0, -5);
|
||||
}
|
||||
return last;
|
||||
const parsed: path.ParsedPath = path.parse(profilePath);
|
||||
return parsed.name;
|
||||
}
|
||||
|
||||
public async resolveSparoProfileAsync(
|
||||
|
|
10
common/changes/sparo/main_2024-03-05-03-36.json
Normal file
10
common/changes/sparo/main_2024-03-05-03-36.json
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"changes": [
|
||||
{
|
||||
"packageName": "sparo",
|
||||
"comment": "",
|
||||
"type": "none"
|
||||
}
|
||||
],
|
||||
"packageName": "sparo"
|
||||
}
|
Loading…
Reference in a new issue