Skip to content

Commit 188dff7

Browse files
authored
Merge pull request #1124 from appwrite/fix-type-generation
fix: type generation not working for appwrite.config.json
2 parents 5c416dc + a01faee commit 188dff7

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

example.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ function getSSLPage($url) {
3838
}
3939

4040
// Leave the platform you want uncommented
41-
$platform = 'client';
42-
// $platform = 'console';
41+
// $platform = 'client';
42+
$platform = 'console';
4343
// $platform = 'server';
4444

45-
$version = '1.8.x';
45+
$version = '1.7.x';
4646
$spec = getSSLPage("https://raw.githubusercontent.com/appwrite/appwrite/{$version}/app/config/specs/swagger2-{$version}-{$platform}.json");
4747

4848
if(empty($spec)) {

templates/cli/lib/commands/types.js.twig

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,10 @@ const typesCommand = actionRunner(async (rawOutputDirectory, {language, strict})
9797
fs.mkdirSync(outputDirectory, { recursive: true });
9898
}
9999

100-
if (!fs.existsSync("appwrite.json")) {
101-
throw new Error("appwrite.json not found in current directory");
102-
}
103-
104100
const collections = localConfig.getCollections();
105101
if (collections.length === 0) {
106-
throw new Error("No collections found in appwrite.json");
102+
const configFileName = path.basename(localConfig.path);
103+
throw new Error(`No collections found in configuration. Make sure ${configFileName} exists and contains collections.`);
107104
}
108105

109106
log(`Found ${collections.length} collections: ${collections.map(c => c.name).join(", ")}`);

0 commit comments

Comments
 (0)