| Conditions | 4 |
| Paths | 3 |
| Total Lines | 23 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | import path from 'path' |
||
| 12 | export function unpublish(filePath) { |
||
| 13 | var tplUrl = FileParser.getFileDataFromUrl(path.join(config.publish.url, filePath)) |
||
| 14 | if(coreUtils.file.exist(tplUrl.json.path)) { |
||
| 15 | var json = JSON.parse(JSON.stringify(FileParser.getJson(tplUrl.json.path))) |
||
| 16 | if(typeof json.abe_meta.publish !== 'undefined' && json.abe_meta.publish !== null) { |
||
| 17 | delete json.abe_meta.publish |
||
| 18 | } |
||
| 19 | |||
| 20 | cmsOperations.save.save( |
||
| 21 | path.join(config.root, config.draft.url, json.abe_meta.link.replace(config.root)), |
||
| 22 | json.abe_meta.template, |
||
| 23 | json, |
||
| 24 | '', |
||
| 25 | 'reject', |
||
| 26 | null, |
||
| 27 | 'reject' |
||
| 28 | ) |
||
| 29 | .then((resSave) => { |
||
|
|
|||
| 30 | FileParser.removeFile(tplUrl.publish.path, tplUrl.publish.json) |
||
| 31 | Manager.instance.updateList() |
||
| 32 | }) |
||
| 33 | } |
||
| 34 | } |
This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.