diff --git a/src/core/guillotine.scala b/src/core/guillotine-core.scala similarity index 98% rename from src/core/guillotine.scala rename to src/core/guillotine-core.scala index 3647226..e845ce2 100644 --- a/src/core/guillotine.scala +++ b/src/core/guillotine-core.scala @@ -225,7 +225,7 @@ object Command: val commandText: Text = formattedArguments(command.arguments) if commandText.contains(t"\"") then t"sh\"\"\"$commandText\"\"\"" else t"sh\"$commandText\"" - given Show[Command] = command => formattedArguments(command.arguments) + given Command is Showable = command => formattedArguments(command.arguments) case class Command(arguments: Text*) extends Executable: def fork[ResultType]()(using working: WorkingDirectory) @@ -244,7 +244,7 @@ object Pipeline: pipeline => msg"${pipeline.commands.map(_.show).join(t" | ")}" given Debug[Pipeline] = _.commands.map(_.debug).join(t" | ") - given Show[Pipeline] = _.commands.map(_.show).join(t" | ") + given Pipeline is Showable = _.commands.map(_.show).join(t" | ") case class Pipeline(commands: Command*) extends Executable: def fork[ResultType]()(using working: WorkingDirectory) @@ -381,7 +381,6 @@ trait Parameterizable: def show(value: Self): Text object Guillotine: - def sh(context: Expr[StringContext], parts: Expr[Seq[Any]])(using Quotes): Expr[Command] = import quotes.reflect.* @@ -393,3 +392,6 @@ object Guillotine: '{${Sh.Prefix.expand(context, parts)}.asInstanceOf[commandType]} given Realm = realm"guillotine" + +extension (inline context: StringContext) + transparent inline def sh(inline parts: Any*): Any = ${Guillotine.sh('context, 'parts)} diff --git a/src/core/posix.scala b/src/core/guillotine.PosixCommands.scala similarity index 100% rename from src/core/posix.scala rename to src/core/guillotine.PosixCommands.scala diff --git a/src/core/shextension.scala b/src/core/shextension.scala deleted file mode 100644 index 2cc4073..0000000 --- a/src/core/shextension.scala +++ /dev/null @@ -1,22 +0,0 @@ -/* - Guillotine, version [unreleased]. Copyright 2024 Jon Pretty, Propensive OÜ. - - The primary distribution site is: https://propensive.com/ - - Licensed under the Apache License, Version 2.0 (the "License"); you may not use this - file except in compliance with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software distributed under the - License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, - either express or implied. See the License for the specific language governing permissions - and limitations under the License. -*/ - -package guillotine - -import language.experimental.captureChecking - -extension (inline context: StringContext) - transparent inline def sh(inline parts: Any*): Any = ${Guillotine.sh('context, 'parts)}