Skip to content

Commit

Permalink
resolved issue #3
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammad-Khalid committed Oct 12, 2020
1 parent 90f48ea commit 26a12d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dabblelab/autopilot-core",
"version": "1.0.0-beta.12",
"version": "1.0.0",
"description": "Core functionality for the Twilio Autopilot CLI and the Twilio Autopilot Plugin for the Twilio CLI.",
"main": "index.js",
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions src/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ module.exports = {
createAssistantJSONFile : async (filename, recoverSchema = false) => {
if(recoverSchema){
if(checkDirectoryExists()){
await fs.writeFileSync(path.join(twilioRecoverySchemaDir,`backup-${filename}.json`),prettyJSONStringify({}));
await fs.writeFileSync(path.join(twilioRecoverySchemaDir,`backup-${filename}.json`), prettyJSONStringify({}));
return `backup-${filename}.json`;
}
}else{
try{
if(fs.existsSync(path.join(process.cwd(),`${filename}.json`))){
filename = `${filename}-${Date.now()}.json`;
await fs.writeFileSync(path.join(process.cwd(),filename));
await fs.writeFileSync(path.join(process.cwd(),filename), prettyJSONStringify({}));
return filename;
}else{
await fs.writeFileSync(path.join(process.cwd(),`${filename}.json`),{});
await fs.writeFileSync(path.join(process.cwd(),`${filename}.json`), prettyJSONStringify({}));
return `${filename}.json`;
}
} catch (err){
Expand Down

0 comments on commit 26a12d2

Please sign in to comment.