@cerema/cadriciel 1.3.7 → 1.3.8

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.
@@ -88,7 +88,8 @@ module.exports = (args) => {
88
88
  return {
89
89
  info: {
90
90
  title: 'install',
91
- description: 'Installation des dépendances',
91
+ description:
92
+ 'Installation des dépendances (La première fois uniquement).)',
92
93
  },
93
94
  start: () => {
94
95
  addMapping();
package/lib/cadriciel.js CHANGED
@@ -11,6 +11,7 @@ class CadricielAPI {
11
11
  if (!token) {
12
12
  try {
13
13
  token = fs.readFileSync(HomeDir + '/account', 'utf-8');
14
+ token = token.replace(/\n/g, '');
14
15
  } catch (e) {
15
16
  console.log(e);
16
17
  console.log(
package/lib/util.js CHANGED
@@ -16,16 +16,16 @@ const capitalizeFirstLetter = (string) => {
16
16
  };
17
17
  const getAccount = async () => {
18
18
  try {
19
- var txt = await readFile(`${userHomeDir}/.cadriciel/account`);
20
- return jwt.decode(txt);
19
+ var txt = await readFile(`${userHomeDir}/.cadriciel/account`, 'utf-8');
20
+ return jwt.decode(txt.replace(/\n/g, ''));
21
21
  } catch (e) {
22
22
  log.error("Vous n'êtes pas authentifié.");
23
23
  }
24
24
  };
25
25
  const getAccountToken = async () => {
26
26
  try {
27
- var txt = await readFile(`${userHomeDir}/.cadriciel/account`);
28
- return txt;
27
+ var txt = await readFile(`${userHomeDir}/.cadriciel/account`, 'utf-8');
28
+ return txt.replace(/\n/g, '');
29
29
  } catch (e) {
30
30
  log.error("Vous n'êtes pas authentifié.");
31
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cerema/cadriciel",
3
- "version": "1.3.7",
3
+ "version": "1.3.8",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "npm": ">=8.0.0",