

&"$PSScriptRoot\vars.ps1"

if ((-Not (Test-Path "$ROOT/Config/markbookHighlight.ini" -PathType Leaf)))
{
    Copy-Item "$ROOT/Config/markbookHighlight.ini.example" "$ROOT/Config/markbookHighlight.ini"
}

if ((-Not (Test-Path "$ROOT/Config/vocabulary.ini" -PathType Leaf)))
{
    Copy-Item "$ROOT/Config/vocabulary.ini.example" "$ROOT/Config/vocabulary.ini"
}

if (-Not (Test-Path "$ROOT/Config/config.ini" -PathType Leaf)) {
    Copy-Item "$ROOT/Config/config.ini.example" "$ROOT/Config/config.ini"
}

if (-Not (Test-Path "$ROOT/Config/.env" -PathType Leaf)) {
    Copy-Item "$ROOT/Config/.env.example" "$ROOT/Config/.env"
}

# New Files

[void](New-Item -ItemType "file" -Path "$ROOT/Var/" -Name "LoginImages.json" -Value "{}" -ErrorAction SilentlyContinue)

Write-Host "Check temp directories exist"

@(
'Var\Apps\',
'Var\DailyImages\',
'Var\DbSchemaCedar\',
'Var\DbSchemaCisa\',
'Var\DbCache\',
'Var\FileCache\',
'Var\FileStore\',
'Var\Photos\',
'Var\Photos\Cache\',
'Var\Photos\Student\',
'Var\Photos\Upload\',
'Var\Photos\test\',
'Var\Store\'
'Var\Upgrade\'
'Var\temp\'
) | ForEach-Object {
    if ((-Not (Test-Path -Path "$ROOT\$_")))
    {
        [void](New-Item -Path "$ROOT\$_" -Type Directory)
    }
}

&"$ROOT\Scripts\permissions.ps1"

# Download composer from GITHUB

#&"$ROOT\Scripts\check-dep.ps1"
