πŸš€ Big News:Socket Has Acquired Secure Annex.Learn More β†’
Socket
Book a DemoSign in
Socket

@platforma-open/milaboratories.software-small-binaries.guided-command

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@platforma-open/milaboratories.software-small-binaries.guided-command - npm Package Compare versions

Comparing version
1.0.2
to
1.0.3
+1
-1
dist/tengo/software/main.sw.json

@@ -1,1 +0,1 @@

{"name":"@platforma-open/milaboratories.software-small-binaries.guided-command:main","binary":{"type":"binary","registry":"platforma-open","package":"platforma-open/milaboratories.software-small-binaries.guided-command/main/1.0.2-{os}-{arch}.tgz","cmd":["{pkg}/guided-command"],"envVars":[]}}
{"name":"@platforma-open/milaboratories.software-small-binaries.guided-command:main","binary":{"type":"binary","registry":"platforma-open","package":"platforma-open/milaboratories.software-small-binaries.guided-command/main/1.0.3-{os}-{arch}.tgz","cmd":["{pkg}/guided-command"],"envVars":[]}}
{
"name": "@platforma-open/milaboratories.software-small-binaries.guided-command",
"version": "1.0.2",
"version": "1.0.3",
"description": "Command you fully control: when it starts, when writes file and when it exits",

@@ -30,2 +30,5 @@ "block-software": {

},
"files": [
"dist/"
],
"keywords": [],

@@ -32,0 +35,0 @@ "author": "",

 WARN  Issue while reading "/home/runner/work/small-binaries/small-binaries/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
> @platforma-open/milaboratories.software-small-binaries.guided-command@1.0.2 build /home/runner/work/small-binaries/small-binaries/guided-command
> ../scripts/build.sh './guided-command.go' 'guided-command' && pl-pkg build --all-platforms
# Building package. go='./guided-command.go' bin='guided-command'...
## os='windows', arch='amd64':
## os='linux', arch='amd64':
## os='linux', arch='arm64':
## os='darwin', arch='amd64':
## os='darwin', arch='arm64':
All binaries are saved to '/home/runner/work/small-binaries/small-binaries/guided-command/build'
info: Rendering entrypoint descriptors...
info: Writing entrypoint descriptor to '/home/runner/work/small-binaries/small-binaries/guided-command/dist/tengo/software/main.sw.json'
info: Building software package 'main' for platform 'linux-x64'...
info: packing software into a package
info: generating package for os='linux', arch='x64'
info: software package was written to '/home/runner/work/small-binaries/small-binaries/guided-command/pkg-platforma-open-milaboratories.software-small-binaries.guided-command-main-1.0.2-linux-x64.tgz'
info: Building software package 'main' for platform 'linux-aarch64'...
info: packing software into a package
info: generating package for os='linux', arch='aarch64'
info: software package was written to '/home/runner/work/small-binaries/small-binaries/guided-command/pkg-platforma-open-milaboratories.software-small-binaries.guided-command-main-1.0.2-linux-aarch64.tgz'
info: Building software package 'main' for platform 'macosx-x64'...
info: packing software into a package
info: generating package for os='macosx', arch='x64'
info: software package was written to '/home/runner/work/small-binaries/small-binaries/guided-command/pkg-platforma-open-milaboratories.software-small-binaries.guided-command-main-1.0.2-macosx-x64.tgz'
info: Building software package 'main' for platform 'macosx-aarch64'...
info: packing software into a package
info: generating package for os='macosx', arch='aarch64'
info: software package was written to '/home/runner/work/small-binaries/small-binaries/guided-command/pkg-platforma-open-milaboratories.software-small-binaries.guided-command-main-1.0.2-macosx-aarch64.tgz'
info: Building software package 'main' for platform 'windows-x64'...
info: packing software into a package
info: generating package for os='windows', arch='x64'
info: software package was written to '/home/runner/work/small-binaries/small-binaries/guided-command/pkg-platforma-open-milaboratories.software-small-binaries.guided-command-main-1.0.2-windows-x64.tgz'

Sorry, the diff of this file is not supported yet

{"registry":"platforma-open","package":"platforma-open/milaboratories.software-small-binaries.guided-command/main/1.0.2-{os}-{arch}.tgz"}

Sorry, the diff of this file is not supported yet

{"registry":"platforma-open","package":"platforma-open/milaboratories.software-small-binaries.guided-command/main/1.0.2-{os}-{arch}.tgz"}

Sorry, the diff of this file is not supported yet

{"registry":"platforma-open","package":"platforma-open/milaboratories.software-small-binaries.guided-command/main/1.0.2-{os}-{arch}.tgz"}

Sorry, the diff of this file is not supported yet

{"registry":"platforma-open","package":"platforma-open/milaboratories.software-small-binaries.guided-command/main/1.0.2-{os}-{arch}.tgz"}

Sorry, the diff of this file is not supported yet

{"registry":"platforma-open","package":"platforma-open/milaboratories.software-small-binaries.guided-command/main/1.0.2-{os}-{arch}.tgz"}
# @platforma-open/milaboratories.software-small-binaries.guided-command
## 1.0.2
### Patch Changes
- 8cb1475: Make all subpackages public to make changesets work :(
## 1.0.1
### Patch Changes
- f8fe77c: Switch to new workflow. No functional changes in packages are expected
package main
import (
"context"
"errors"
"fmt"
"math/rand"
"os"
"os/signal"
"syscall"
"time"
)
func main() {
ctx, cancelCtx := signal.NotifyContext(context.Background(), os.Interrupt, os.Kill, syscall.SIGTERM)
defer cancelCtx()
if len(os.Args) < 4 {
fmt.Fprintf(os.Stderr, "Usage: %s <startedPath> <unlockPath> <donePath> [<doneText>]", os.Args[0])
os.Exit(1)
}
startedPath := os.Args[1]
unlockPath := os.Args[2]
donePath := os.Args[3]
doneText := "done"
if len(os.Args) == 5 {
doneText = os.Args[4]
}
pidStr := fmt.Sprintf("%d", os.Getpid())
err := writeFileAtomic(startedPath, []byte(pidStr), 0o666)
if err != nil {
fmt.Fprintf(os.Stderr, "failed to create 'i'm started' file %q: %v", startedPath, err)
os.Exit(1)
}
WaitForUnblockFile:
for {
select {
case <-ctx.Done():
err = os.Remove(startedPath)
if err != nil {
fmt.Fprintf(os.Stderr, "failed to remove 'i'm started' file %q after stop signal: %v", startedPath, err)
os.Exit(1)
}
os.Exit(0)
case <-time.After(10 * time.Millisecond):
_, err = os.Stat(unlockPath)
if err == nil {
break WaitForUnblockFile
}
if errors.Is(err, os.ErrNotExist) {
continue
}
fmt.Fprintf(os.Stderr, "failed wait for 'unlock' file %q: %v", unlockPath, err)
os.Exit(1)
}
}
err = writeFileAtomic(donePath, []byte(doneText), 0o666)
if err != nil {
fmt.Fprintf(os.Stderr, "failed to create 'i'm done' file %q: %v", donePath, err)
os.Exit(1)
}
}
func writeFileAtomic(filePath string, data []byte, mode os.FileMode) error {
filePathTmp := fmt.Sprintf("%s.%s", filePath, randStr(5))
err := os.WriteFile(filePathTmp, data, mode)
if err != nil {
return fmt.Errorf("failed to create intermediate tmp file for %q: %w", filePathTmp, err)
}
err = os.Rename(filePathTmp, filePath)
if err != nil {
return fmt.Errorf("failed to rename intermediate tmp file %q to %q: %w", filePathTmp, filePath, err)
}
return nil
}
func randStr(length int) string {
const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
variety := len(charset)
ret := make([]byte, length)
for i := range ret {
ret[i] = charset[rand.Intn(variety)]
}
return string(ret)
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet