feat: support tilde when resolving uses block
This commit is contained in:
parent
e387097dc1
commit
5069ab8ce7
1 changed files with 11 additions and 4 deletions
|
|
@ -1,3 +1,5 @@
|
|||
import os from "node:os";
|
||||
|
||||
export interface PackageSlug {
|
||||
ownerSlug: string;
|
||||
packageSlug: string;
|
||||
|
|
@ -61,13 +63,18 @@ export function decodePackageIdentifier(identifier: string): PackageIdentifier {
|
|||
fileUri: identifier.substring(7),
|
||||
};
|
||||
}
|
||||
// Otherwise, it's a slug
|
||||
else {
|
||||
// support ~ by replacing with home directory
|
||||
else if (identifier.startsWith("~")) {
|
||||
return {
|
||||
uriType: "slug",
|
||||
fullSlug: decodeFullSlug(identifier),
|
||||
uriType: "file",
|
||||
fileUri: identifier.replace("~", os.homedir()),
|
||||
};
|
||||
}
|
||||
// Otherwise, it's a slug
|
||||
return {
|
||||
uriType: "slug",
|
||||
fullSlug: decodeFullSlug(identifier),
|
||||
};
|
||||
}
|
||||
|
||||
export enum VirtualTags {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue