@@ -362,7 +362,7 @@ func (s *Session) BuildDir(packagePath string, importPath string, pkgObj string)
362
362
if pkgObj == "" {
363
363
pkgObj = filepath .Base (packagePath ) + ".js"
364
364
}
365
- if err := s .WriteCommandPackage (pkg , pkgObj ); err != nil {
365
+ if err := s .WriteCommandPackage (pkg . Archive , pkgObj ); err != nil {
366
366
return err
367
367
}
368
368
return nil
@@ -391,7 +391,7 @@ func (s *Session) BuildFiles(filenames []string, pkgObj string, packagePath stri
391
391
if s .Types ["main" ].Name () != "main" {
392
392
return fmt .Errorf ("cannot build/run non-main package" )
393
393
}
394
- return s .WriteCommandPackage (pkg , pkgObj )
394
+ return s .WriteCommandPackage (pkg . Archive , pkgObj )
395
395
}
396
396
397
397
func (s * Session ) BuildImportPath (path string ) (* compiler.Archive , error ) {
@@ -561,11 +561,7 @@ func (s *Session) writeLibraryPackage(pkg *PackageData, pkgObj string) error {
561
561
return compiler .WriteArchive (pkg .Archive , objFile )
562
562
}
563
563
564
- func (s * Session ) WriteCommandPackage (pkg * PackageData , pkgObj string ) error {
565
- if ! pkg .IsCommand () || pkg .UpToDate {
566
- return nil
567
- }
568
-
564
+ func (s * Session ) WriteCommandPackage (archive * compiler.Archive , pkgObj string ) error {
569
565
if err := os .MkdirAll (filepath .Dir (pkgObj ), 0777 ); err != nil {
570
566
return err
571
567
}
@@ -592,7 +588,7 @@ func (s *Session) WriteCommandPackage(pkg *PackageData, pkgObj string) error {
592
588
sourceMapFilter .MappingCallback = NewMappingCallback (m , s .options .GOROOT , s .options .GOPATH )
593
589
}
594
590
595
- deps , err := compiler .ImportDependencies (pkg . Archive , s .BuildImportPath )
591
+ deps , err := compiler .ImportDependencies (archive , s .BuildImportPath )
596
592
if err != nil {
597
593
return err
598
594
}
0 commit comments