Skip to content

Commit 7c96d70

Browse files
committed
Fix broken CLI entrypoint
Signed-off-by: worksofliam <[email protected]>
1 parent ad438c0 commit 7c96d70

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

cli/src/index.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ async function main() {
154154
process.exit(0);
155155
}
156156

157-
const targets = new Targets(cwd);
157+
const fs = new ReadFileSystem();
158+
const targets = new Targets(cwd, fs);
158159

159160
targets.setSuggestions({
160161
includes: cliSettings.fixIncludes,
@@ -165,8 +166,6 @@ async function main() {
165166

166167
let files: string[];
167168

168-
const fs = new ReadFileSystem();
169-
170169
try {
171170
files = await fs.getFiles(cwd, scanGlob);
172171
} catch (e) {
@@ -209,7 +208,7 @@ async function main() {
209208

210209
if (cliSettings.lookupFiles && cliSettings.buildFile === `none`) {
211210
for (const value of cliSettings.lookupFiles) {
212-
listDeps(cwd, targets, value);
211+
await listDeps(cwd, targets, value);
213212
}
214213
}
215214

@@ -280,7 +279,7 @@ function initProject(cwd) {
280279
/**
281280
* @param query Can be object (ABCD.PGM) or relative path
282281
*/
283-
function listDeps(cwd: string, targets: Targets, query: string) {
282+
async function listDeps(cwd: string, targets: Targets, query: string) {
284283
const fullPath = path.join(cwd, query);
285284

286285
let [name, type] = query.split(`.`);
@@ -291,7 +290,7 @@ function listDeps(cwd: string, targets: Targets, query: string) {
291290
let theObject = targets.getResolvedObjects().find(o => o.systemName === name && o.type === type);
292291

293292
if (!theObject) {
294-
theObject = targets.resolvePathToObject(fullPath);
293+
theObject = await targets.resolvePathToObject(fullPath);
295294
}
296295

297296
const allDeps = targets.getTargets();

0 commit comments

Comments
 (0)