Giter Site home page Giter Site logo

Comments (7)

PlagueHO avatar PlagueHO commented on July 18, 2024

There doesn't seem to be a clear pattern for getting the temp folder location in different platforms: PowerShell/PowerShell#4216

So it might just be simplest to add a Get-TempPath utility function that just returns:

  • Windows: $env:TEMP
  • macOS: $env:TMPDIR
  • Linux: /tmp

from psdeploy.

PlagueHO avatar PlagueHO commented on July 18, 2024

@RamblingCookieMonster - are you happy for me to submit a PR to fix this by adding a new Get-TempFolder utility function in the /Private/PSYaml/Private/ folder?

from psdeploy.

RamblingCookieMonster avatar RamblingCookieMonster commented on July 18, 2024

Eek, sorry, forgot about this!

Sure! I could see that function being useful for other bits.

If it's easier, you could also do something like

  • Remove the default value from the line you pasted
  • Add a simple if (-not $ShadowPath`) bit that sets the default if not specified, and only in the Windows section of that logic

Either works for me!

from psdeploy.

PlagueHO avatar PlagueHO commented on July 18, 2024

Cool! In progress now - thanks @RamblingCookieMonster !

from psdeploy.

PlagueHO avatar PlagueHO commented on July 18, 2024

@RamblingCookieMonster - I've been looking at this one closely and there is one thing I find strange: The 'Windows only' code (the New-Item line) seems to fire under Linux and macOS on TravisCI and Azure Pipelines? It looks like it shouldn't execute in those environments.

It seems that this test evaluates to true:

if(!(Test-Path -Path Variable:\IsWindows) -or $IsWindows) {
}

I've done a bunch of tests on my local Ubuntu server and on the TravisCI to confirm the result of the above test:
https://travis-ci.org/PlagueHO/CosmosDB/jobs/431726377#L2803

What it shows is that the above test should not have evaluated to True on TravisCI so this code shouldn't have executed but for some reason it does (https://travis-ci.org/PlagueHO/CosmosDB/jobs/431726377#L2808)?

Completely stumped as to why this code executes...

Any idea why?

from psdeploy.

RamblingCookieMonster avatar RamblingCookieMonster commented on July 18, 2024

Weird!! I... might just poke around and see if powershell-yaml is compatible, for some reason didn't use it at the start - works cross platform, haven't had any issues in other modules

from psdeploy.

PlagueHO avatar PlagueHO commented on July 18, 2024

It is really odd indeed. It doesn't actually stop the module from working BTW - at least not for me. It just logs the exception.

from psdeploy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.