Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove unused and/or problematic code #3

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 20 additions & 16 deletions jsrc/bashPath.sc
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
#!/usr/bin/env -S scala
//package vastblue.demo

//> using scala "3.3.1"
//> using lib "org.vastblue::pallet::0.10.6"
//> using lib "org.vastblue::pallet::0.10.7"

import vastblue.pallet.*

lazy val bashPath = where("bash").path
object BashPath {
val bashPath = where("bash").path

def main(args: Array[String]): Unit =
printf("userhome: [%s]\n", userhome)
import scala.sys.process.*
val progname = if (isWindows) {
"where.exe"
} else {
"which"
def main(args: Array[String]): Unit = {
printf("userhome: [%s]\n", userhome)
import scala.sys.process.*
val progname = if (isWindows) {
"where.exe"
} else {
"which"
}
val whereBash = Seq(progname, "bash").lazyLines_!.take(1).mkString
printf("first bash in path:\n%s\n", whereBash)
printf("%s\n", bashPath)
printf("%s\n", bashPath.realpath)
printf("%s\n", bashPath.toRealPath())
printf("shellRoot: %s\n", shellRoot)
printf("sys root: %s\n", where("bash").posx.replaceAll("(/usr)?/bin/bash.*", ""))
}
val whereBash = Seq(progname, "bash").lazyLines_!.take(1).mkString
printf("first bash in path:\n%s\n", whereBash)
printf("%s\n", bashPath)
printf("%s\n", bashPath.realpath)
printf("%s\n", bashPath.toRealPath())
printf("posixroot: %s\n", posixroot)
printf("sys root: %s\n", where("bash").norm.replaceAll("(/usr)?/bin/bash.*", ""))
}
4 changes: 2 additions & 2 deletions jsrc/bashPathCli.sc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env -S scala-cli shebang

//> using scala "3.3.1"
//> using lib "org.vastblue::pallet::0.10.6"
//> using lib "org.vastblue::pallet::0.10.7"

import vastblue.pallet.*

Expand All @@ -21,6 +21,6 @@ def main(args: Array[String]): Unit =
printf("%s\n", bashPath.realpath)
printf("%s\n", bashPath.toRealPath())
printf("posixroot: %s\n", posixroot)
printf("sys root: %s\n", where("bash").norm.replaceAll("(/usr)?/bin/bash.*", ""))
printf("sys root: %s\n", where("bash").posx.replaceAll("(/usr)?/bin/bash.*", ""))

main(args)
Loading
Loading