Skip to content

strip absolute path to input and output files #228

Open

Description

@alperyilmaz

When I run the Drake file under demos/McIlroy, I get the following output:

user@n550:~/tmp/workflow-pipelines/drake/demos/McIlroy$ drake 
Using DRAKE_HOME: /home/user/tmp/workflow-pipelines/drake
Using drip to start up JVM...
The following steps will be run, in order:
  1: /home/user/tmp/workflow-pipelines/drake/demos/McIlroy/././word-freqs.txt <- /home/user/tmp/workflow-pipelines/drake/demos/McIlroy/././book.txt [missing output]
Confirm? [y/n] y
Running 1 steps with concurrence of 1...

--- 0. Running (missing output): /home/user/tmp/workflow-pipelines/drake/demos/McIlroy/././word-freqs.txt <- /home/user/tmp/workflow-pipelines/drake/demos/McIlroy/././book.txt
--- 0: /home/user/tmp/workflow-pipelines/drake/demos/McIlroy/././word-freqs.txt <- /home/user/tmp/workflow-pipelines/drake/demos/McIlroy/././book.txt -> done in 0.07s
Done (1 steps run).

Is it possible to strip paths to files? So that the output looks like:

The following steps will be run, in order:
  1: word-freqs.txt <- book.txt [missing output]
Confirm? [y/n]

Activity

  1. nfultz commented on Aug 17, 2018

    @nfultz
  2. chen-factual commented on Aug 17, 2018

    @chen-factual
    Contributor

    This has actually long been a pet peeves of mine, I can look into making a fix unless @nfultz you've already got one?

  3. nfultz commented on Aug 17, 2018

    @nfultz

    Go for it :)

  4. dirtyvagabond commented on Aug 20, 2018

    @dirtyvagabond
    Contributor

    @nfultz and @chen-factual thanks for looking at this! A minor caveat to consider: what to do for the edge case where stripping paths makes the naming ambiguous?

    For example, with paths it looks like:
    /home/user/other/stuff/output/my-file.txt <- /home/user/other/stuff/input/my-file.txt

    Then, do this new feature and strip the paths, now it looks like:
    my-file.txt <- my-file.txt

    I guess you want to think about whether to bother detecting ambiguities, and what do when you detect them. If you choose not to bother, then the user is probably owed some kind of switch or setting to request full paths for clarity.

  5. nfultz commented on Aug 20, 2018

    @nfultz
  6. chen-factual commented on Aug 20, 2018

    @chen-factual
    Contributor

    Maybe removing the common prefix would be better than removing the entire
    thing

    That's a good idea, for instance my emacs does this when I have multiple core.cljs open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions