{
	"name": "FireIde.Core.Manifest.AddModule",
	"json": {
		"@scopeSet(manifestExists)": {
			"@FireIde.Core.Fs.PathExists": "ignition.manifest.json"
		},
		"@if(manifestExists)": {
			"@scopeSet(moduleName)": {
				"@input": null
			},
			"@scopeSet(manifest)": {
				"@Commons.JSON.Parse": {
					"@FireIde.Core.Fs.ReadFile": "ignition.manifest.json"
				}
			},
			"@unless(manifest.modules)": {
				"@set(manifest.modules)": []
			},
			"@scopeSet(moduleNotInManifest)": {
				"@equals": [
				{
					"@FireIde.Core.IndexOf(manifest.modules)": {
						"@get(moduleName)": null
					}
				}, -1]
			},
			"@if(moduleNotInManifest)": {
				"@FireIde.Core.Array.Push(manifest.modules)": {
					"@get(moduleName)": null
				}
			},
			"@FireIde.Core.Fs.UpdateFile": {
				"path": "ignition.manifest.json",
				"content": {
					"@Commons.JSON.Stringify(2)": {
						"@get(manifest)": null
					}
				}
			}
		},
		"@unless(manifestExists)": {
			"@FireIde.Core.Fs.UpdateFile": {
				"path": "ignition.manifest.json",
				"content": {
					"@Commons.JSON.Stringify(2)": {
						"modules": [
							{
								"@input": null
							}
						]
					}
				}
			}
		}
	}
}