code: func copyFile(sourceDir, sourceFile, destDir string, libRootURLs []string) error {
  	var source io.Reader
  
  	if strings.HasPrefix(sourceFile, "http://") || strings.HasPrefix(sourceFile, "https://") {
  		resp, err := http.Get(sourceFile)
  		if err != nil {
  			return err
  		}
  		defer resp.Body.Close()
  		source = resp.Body
  	} else {
  		sourceFile, err := os.Open(filepath.Join(sourceDir, sourceFile))
  		if err != nil {
  			return err
  		}
  		source = sourceFile
  	}
  
  	dest := filepath.Join(destDir, libraries.StripLibRootURL(sourceFile, libRootURLs))
  
  	// create target dir if needed
  	if err := os.MkdirAll(filepath.Dir(dest), 0777); err != nil {
  		return err
  	}
  
  	// creaate dest file
  	destFile, err := os.OpenFile(dest, os.O_CREATE|os.O_RDWR, 0666)
  	if err != nil {
  		return err
  	}
  
  	_, err = io.Copy(destFile, source)
  	return err
  }
docs: // copy file from source to dest