var fs = require('fs-extra')
var c = require('chalk')
var path = require('path')
var sync = require(__dirname + '/sync.js')

module.exports = function (argv) {

  var conceptsDir = process.cwd() + '/concepts'
  var dialectsDir = process.cwd() + '/dialects'

  // delete all concepts
  if (argv.all) {
    fs.removeSync(conceptsDir)
    return fs.removeSync(dialectsDir)
  }

  var conceptDir = argv._[1]
  var conceptPath = conceptsDir + '/' + conceptDir

  // delete concept dir
  if (fs.existsSync(conceptPath)) {

    fs.removeSync(conceptPath)
    sync(argv)

  } else {
    return console.log(c.bold('\n %s') + c.red(' does not exists\n'), conceptPath)
  }

}

@@ -121,47 +121,44 @@
 s')%0A
-%0Amodule.exports = function (argv) %7B%0A%0A  
+var isDir = require('is-directory')%0A
 var 
@@ -199,18 +199,16 @@
 ncepts'%0A
-  
 var dial
@@ -246,16 +246,52 @@
 lects'%0A%0A
+module.exports = function (argv) %7B%0A%0A
   // del
@@ -412,21 +412,42 @@
  concept
-Dir =
+Path = conceptsDir + '/' +
  argv._%5B
@@ -453,85 +453,122 @@
 %5B1%5D%0A
+%0A
   
-var conceptPath = conceptsDir + '/' + conceptDir%0A%0A  // delete concept dir%0A 
+// delete concept dir%0A  if (isDir.sync(conceptPath)) %7B%0A%0A    fs.removeSync(conceptPath)%0A    sync(argv)%0A%0A  %7D else
  if 
@@ -585,32 +585,41 @@
 Sync(conceptPath
+ + '.txt'
 )) %7B%0A%0A    fs.rem
@@ -629,33 +629,63 @@
 Sync(conceptPath
-)
+ + '.txt')%0A    argv.file = true
 %0A    sync(argv)%0A

delete file