Skip to content

Commit 4b363a1

Browse files
authored
Merge pull request #1106 from appwrite/fix-null-parsing
fix: parsing null values in cli
2 parents 43316b1 + 1753202 commit 4b363a1

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -845,10 +845,14 @@ const attributesToCreate = async (remoteAttributes, localAttributes, collection,
845845

846846
if (!cliConfig.force) {
847847
if (deleting.length > 0 && !isIndex) {
848-
log(`Attribute deletion will cause ${chalk.red('loss of data')}`);
848+
console.log(`${chalk.red('-------------------------------------------------------')}`);
849+
console.log(`${chalk.red('| WARNING: Attribute deletion may cause loss of data |')}`);
850+
console.log(`${chalk.red('-------------------------------------------------------')}`);
849851
}
850852
if (conflicts.length > 0 && !isIndex) {
851-
log(`Attribute recreation will cause ${chalk.red('loss of data')}`);
853+
console.log(`${chalk.red('---------------------------------------------------------')}`);
854+
console.log(`${chalk.red('| WARNING: Attribute recreation may cause loss of data |')}`);
855+
console.log(`${chalk.red('---------------------------------------------------------')}`);
852856
}
853857

854858
if ((await getConfirmation()) !== true) {

templates/cli/lib/parser.js.twig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ const parse = (data) => {
2424
}
2525

2626
for (let key in data) {
27-
if (Array.isArray(data[key])) {
27+
if (data[key] === null) {
28+
console.log(`${chalk.yellow.bold(key)} : null`);
29+
} else if (Array.isArray(data[key])) {
2830
console.log(`${chalk.yellow.bold.underline(key)}`);
2931
if (typeof data[key][0] === 'object') {
3032
drawTable(data[key]);

0 commit comments

Comments
 (0)