Skip to content

Commit

Permalink
Maybe only check exists once
Browse files Browse the repository at this point in the history
  • Loading branch information
DustinBrett committed May 29, 2022
1 parent f977017 commit a4d78d6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions components/system/Dialogs/Run/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,14 @@ const Run: FC<ComponentProcessProps> = () => {
);
const [resourcePid, ...resourceUrl] = resource.split(" ");
let resourcePath = resource;
const resourceExists = await exists(resourcePath);

if (!(await exists(resourcePath))) {
if (!resourceExists) {
resourcePath =
resourceUrl.length > 0 ? resourceUrl.join("") : resourcePid;
}

if (await exists(resourcePath)) {
if (resourceExists || (await exists(resourcePath))) {
const stats = await stat(resourcePath);

if (stats.isDirectory()) {
Expand Down

0 comments on commit a4d78d6

Please sign in to comment.