/**
# Copyright (c) 2024, HCUOpt CORPORATION.  All rights reserved.
**/

package main

import (
	"dcu-container-toolkit/internal/dcu-tracker"
	"dcu-container-toolkit/internal/runtime"
	"os"
	//"log"
)

func main() {
	//f, _ := os.OpenFile("/var/log/app.log", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
	//log.SetOutput(f)
	r := runtime.New()
	//log.Println("Log written to file")
	err := r.Run(os.Args)
        if err != nil {
	//	log.Println("failed to run runtime")
		dcuTracker, err := dcuTracker.New()
		if err != nil {
	//		log.Println("failed to new dcutracker")
			os.Exit(1)
		}
		dcuTracker.ReleaseDCUs(os.Args[len(os.Args)-1])
	//	log.Println("releasedcu")
		os.Exit(1)
	}
}
