eitri-cli 1.7.0-beta.1 → 1.7.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eitri-cli",
3
- "version": "1.7.0-beta.1",
3
+ "version": "1.7.0-beta.2",
4
4
  "description": "Command Line Interface to make \"Eitri-App\" with code and fire.",
5
5
  "main": "index.js",
6
6
  "bin": {
package/src/cmd/start.js CHANGED
@@ -106,7 +106,13 @@ module.exports = async function start(args) {
106
106
  const friendlyMessage2 = "Recomendamos que verifique eventuais erros no código. Para mais informações, consulte nossa documentação em: https://docs.eitri.tech/."
107
107
  const friendlyMessage3 = "Se o problema persistir, por favor, entre em contato com o suporte técnico do Eitri."
108
108
  const friendlyMessage4 = "Você pode continuar o desenvolvimento localmente, mesmo que a sincronização não esteja disponível no momento."
109
- displayFriendlyErrorAtEnd = `\x1b[1m\x1b[31m\n${friendlyMessage1}\n${friendlyMessage2} \x1b[0m` + "\n" + `\n${friendlyMessage3}\n${friendlyMessage4}\n \x1b[0m`
109
+ displayFriendlyErrorAtEnd = `\x1b[1m\x1b[31m\n${friendlyMessage1}\n${friendlyMessage2} \x1b[0m` + "\n" + `\n${friendlyMessage3}\n${friendlyMessage4}\n\x1b[0m`
110
+
111
+ const errorData = error.response.data
112
+ const commonStartErrors = ['CodeCompileError', 'TagNotFound']
113
+ if(commonStartErrors.includes(errorData.name)) {
114
+ displayFriendlyErrorAtEnd += `\n\x1b[1m\x1b[31mMotivo: ${errorData.friendlyMessage}\x1b[0m\n`;
115
+ }
110
116
  }
111
117
  console.log("Pronto!");
112
118
 
@@ -161,8 +167,10 @@ module.exports = async function start(args) {
161
167
  await trackingService.sendError(e)
162
168
 
163
169
  process.exit(1)
164
- }finally{
170
+ } finally{
165
171
  if(displayFriendlyErrorAtEnd){
172
+ const folderHash = workspace.getFolderHashPath()
173
+ await workspace.transpile([folderHash])
166
174
  console.log("\n\n" + separator + "\n" + displayFriendlyErrorAtEnd + "\n" + separator + "\n\n")
167
175
  }
168
176
  }
@@ -22,8 +22,7 @@ class Watcher {
22
22
  const filePath = name.replace(/\\/g, '/')
23
23
  if (evt === 'remove') {
24
24
  console.log('Apagando', name)
25
- this.workspace.delete(filePath)
26
- return
25
+ return this.workspace.delete(filePath)
27
26
  }
28
27
  fs.stat(filePath, (err, stat) => {
29
28
  if (err) {
@@ -1010,6 +1010,11 @@ class Workspace {
1010
1010
  return Buffer.from(content).toString("base64");
1011
1011
  }
1012
1012
 
1013
+ getFolderHashPath() {
1014
+ const folderHashPath = path.join(this.folder2watch, 'folder.hash');
1015
+ return folderHashPath
1016
+ }
1017
+
1013
1018
  }
1014
1019
 
1015
1020
  module.exports = {