@sequencemedia/crypto 1.1.19 → 1.1.21

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/crypto.sh CHANGED
@@ -35,7 +35,7 @@ get_args () {
35
35
  VERBOSE=true
36
36
  ;;
37
37
  *)
38
- echo Ignoring "$flag"
38
+ # Ignoring "$flag"
39
39
  ;;
40
40
  esac
41
41
  done
package/decrypt.sh CHANGED
@@ -18,15 +18,28 @@ fi
18
18
 
19
19
  if [ -d "$ORIGIN" ];
20
20
  then
21
- if [ -d "$DESTINATION" ];
21
+ if [ -f "$DESTINATION" ];
22
22
  then
23
+ echo Origin is a directory but destination is a file
24
+ exit 1
25
+ else
26
+ mkdir -p "$DESTINATION" 2> /dev/null
23
27
  decrypt_directory "$ORIGIN" "$DESTINATION"
24
28
  exit 0
25
- else
26
- echo Origin is a directory but destination is not a directory
27
- exit 1
29
+ fi
30
+ else
31
+ if [ -f "$ORIGIN" ];
32
+ then
33
+ if [ -d "$DESTINATION" ];
34
+ then
35
+ echo Origin is a file but destination is a directory
36
+ exit 1
37
+ else
38
+ decrypt "$ORIGIN" > "$DESTINATION"
39
+ exit 0
40
+ fi
28
41
  fi
29
42
  fi
30
43
 
31
- decrypt "$ORIGIN" > "$DESTINATION"
32
- exit 0
44
+ echo Origin is neither a file nor a directory
45
+ exit 1
package/encrypt.sh CHANGED
@@ -17,16 +17,29 @@ then
17
17
  fi
18
18
 
19
19
  if [ -d "$ORIGIN" ];
20
+ then
21
+ if [ -f "$DESTINATION" ];
20
22
  then
21
- if [ -d "$DESTINATION" ];
22
- then
23
+ echo Origin is a directory but destination is a file
24
+ exit 1
25
+ else
26
+ mkdir -p "$DESTINATION" 2> /dev/null
23
27
  encrypt_directory "$ORIGIN" "$DESTINATION"
24
28
  exit 0
25
- else
26
- echo Origin is a directory but destination is not a directory
27
- exit 1
29
+ fi
30
+ else
31
+ if [ -f "$ORIGIN" ];
32
+ then
33
+ if [ -d "$DESTINATION" ];
34
+ then
35
+ echo Origin is a file but destination is a directory
36
+ exit 1
37
+ else
38
+ encrypt "$ORIGIN" > "$DESTINATION"
39
+ exit 0
40
+ fi
28
41
  fi
29
42
  fi
30
43
 
31
- encrypt "$ORIGIN" > "$DESTINATION"
32
- exit 0
44
+ echo Origin is neither a file nor a directory
45
+ exit 1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sequencemedia/crypto",
3
- "version": "1.1.19",
3
+ "version": "1.1.21",
4
4
  "keywords": [
5
5
  "crypto",
6
6
  "node",