Skip to content

Commit 41d89d3

Browse files
committed
Fixed indentation
1 parent 9274cc9 commit 41d89d3

File tree

1 file changed

+34
-34
lines changed

1 file changed

+34
-34
lines changed

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

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -120,46 +120,46 @@ const {{ service.name | caseLower }}{{ method.name | caseUcfirst }} = async ({ {
120120
{% for parameter in method.parameters.all %}
121121
{% if parameter.isUploadID %}
122122
if({{ parameter.name | caseCamel | escapeKeyword }} != 'unique()') {
123-
try {
124-
response = await client.call('get', path + '/' + {{ parameter.name }}, headers);
125-
counter = response.chunksUploaded;
126-
} catch(e) {
127-
}
123+
try {
124+
response = await client.call('get', path + '/' + {{ parameter.name }}, headers);
125+
counter = response.chunksUploaded;
126+
} catch(e) {
127+
}
128128
}
129129
{% endif %}
130130
{% endfor %}
131131

132132
for (counter; counter < totalCounters; counter++) {
133-
const start = (counter * libClient.CHUNK_SIZE);
134-
const end = Math.min((((counter * libClient.CHUNK_SIZE) + libClient.CHUNK_SIZE) - 1), size);
135-
136-
headers['content-range'] = 'bytes ' + start + '-' + end + '/' + size;
137-
138-
if (id) {
139-
headers['x-appwrite-id'] = id;
140-
}
141-
142-
const stream = fs.createReadStream(streamFilePath, {
143-
start,
144-
end
133+
const start = (counter * libClient.CHUNK_SIZE);
134+
const end = Math.min((((counter * libClient.CHUNK_SIZE) + libClient.CHUNK_SIZE) - 1), size);
135+
136+
headers['content-range'] = 'bytes ' + start + '-' + end + '/' + size;
137+
138+
if (id) {
139+
headers['x-appwrite-id'] = id;
140+
}
141+
142+
const stream = fs.createReadStream(streamFilePath, {
143+
start,
144+
end
145+
});
146+
payload['{{ parameter.name }}'] = stream;
147+
148+
response = await client.call('{{ method.method | caseLower }}', path, headers, payload{% if method.type == 'location' %}, 'arraybuffer'{% endif %});
149+
150+
if (!id) {
151+
id = response['$id'];
152+
}
153+
154+
if (onProgress !== null) {
155+
onProgress({
156+
$id: response['$id'],
157+
progress: Math.min((counter+1) * libClient.CHUNK_SIZE, size) / size * 100,
158+
sizeUploaded: end+1,
159+
chunksTotal: response['chunksTotal'],
160+
chunksUploaded: response['chunksUploaded']
145161
});
146-
payload['{{ parameter.name }}'] = stream;
147-
148-
response = await client.call('{{ method.method | caseLower }}', path, headers, payload{% if method.type == 'location' %}, 'arraybuffer'{% endif %});
149-
150-
if (!id) {
151-
id = response['$id'];
152-
}
153-
154-
if (onProgress !== null) {
155-
onProgress({
156-
$id: response['$id'],
157-
progress: Math.min((counter+1) * libClient.CHUNK_SIZE, size) / size * 100,
158-
sizeUploaded: end+1,
159-
chunksTotal: response['chunksTotal'],
160-
chunksUploaded: response['chunksUploaded']
161-
});
162-
}
162+
}
163163
}
164164
}
165165
{% endif %}

0 commit comments

Comments
 (0)