Skip to content

Commit

Permalink
fix(aft): generate sdk from local directory which is not a git reposi…
Browse files Browse the repository at this point in the history
…tory (#3436)
  • Loading branch information
NikaHsn authored Jul 21, 2023
1 parent 98595b8 commit b12c326
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,14 @@ class GenerateSdkCommand extends AmplifyCommand with GlobOptions {
if (!await modelsDir.exists()) {
exitError('Model directory ($modelsDir) does not exist');
}
modelsDir = await _checkoutModelsRef(modelsDir, ref);
// Checkout models if modelsPath is a git repository.
if (File(p.join(modelsPath, '.git')).existsSync()) {
modelsDir = await _checkoutModelsRef(modelsDir, ref);
} else {
logger.warn(
'Unable to check out $ref since $modelsDir is not a git repo',
);
}
modelsDir = await _organizeModels(modelsDir);
} else {
modelsDir = await _downloadModels();
Expand Down

0 comments on commit b12c326

Please sign in to comment.