@iankibetsh/shframework 1.4.1 → 1.4.3

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": "@iankibetsh/shframework",
3
- "version": "1.4.1",
3
+ "version": "1.4.3",
4
4
  "description": "Vue library for handling laravel backend",
5
5
  "main": "dist/library.js",
6
6
  "module": "dist/library.mjs",
@@ -1,11 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  const fs = require('fs')
3
3
  const components = require('../repo/helpers/components.js')
4
-
5
4
  const [,, ... args] = process.argv
6
5
  const templatesDir =`${__dirname}/../components/form-components/`
7
6
  const destination = `${process.cwd()}/src/components/form-components/`
8
- if(fs.existsSync(templatesDir)){
7
+ if(args[0] == 'backup'){
9
8
  console.log('Creating component backup')
10
9
  const jsBackupFile =`${__dirname}/../repo/helpers/components.js`
11
10
  !fs.existsSync(destination) && fs.mkdirSync(destination,{ recursive: true })
@@ -32,7 +31,11 @@ if(fs.existsSync(templatesDir)){
32
31
  const file = component.fileName
33
32
  const contents = component.contents
34
33
  const dest = `${destination}${file}`
35
- console.log(`Copy ${file} to ${destination}`)
36
- fs.writeFileSync(dest,contents)
34
+ if(!fs.existsSync(dest)){
35
+ console.log(`Copy ${file} to ${destination}`)
36
+ fs.writeFileSync(dest,contents)
37
+ } else {
38
+ console.log(`${file} Exists Already`)
39
+ }
37
40
  })
38
41
  }