GithubHelp home page GithubHelp logo

vsts-file-creator's Introduction

File Creator

This is a task that can be used to create a file during a build or release process. With the task you can specify the file you want to create and its content.

File creator options

Options

Overwrite file

This allows you to specify if you want to overwrite the file if it already exists. By default this is set to false.

File path

With this property you can specify the path of the file including its name. Example: folder/filename.txt.

File content

Specify the content of the file you want to add.

Should file end with a new line

When this is checked, the task will automatically add a new line at the end the created file.

Feedback

Feedback is always welcome. Please submit it via creating an issue in the repository issue list.

Changelog

[6.0.0] 8/10/2020

  • #7: Added verbose logging setting
  • #8: Fix for SyntaxError in block-scoped declarations
  • #9: Added support for creating empty files
  • #12: Switched the string setting to filePath to be able to select your path

vsts-file-creator's People

Contributors

estruyf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

vsts-file-creator's Issues

Unable to create emtpy file

I'd like to create an empty file, but I can't.
Whether I skip the filecontent argument, set it to an empty string or to a single whitespace, I get the error Input required: filecontent.

How to add new line??

I'm not sure is an issue, I put several lines in the content box and all lines shows as a single line in the output file..

Thanks

Would be nice to be able to browse for the file path

Just like it many other built-in tasks offer a browse option, it'd be a nice addition to have a button to browse.

It really helps avoiding issues with checking that we are configuring a valid path

Sample screenshots of the "archive files" task
image

image

It would be nice to be able to get the file contents via path

Assuming that in my project I have the following file in the "../config/base.json" directory:

{
  "baseUrl": "$(baseUrl)",
  "user": "$(defaultUser)",
  ...
}

It would be nice to be able to get the file in the task instead of providing the content directly.

Something similar to:

- task: file-creator@6
  inputs:
    filepath: "$(System.DefaultWorkingDirectory)/config/settings.json"
    filecontent: |
      cat $(System.DefaultWorkingDirectory)/config/base.json
    fileoverwrite: true
    verbose: true

Multiple lines

Hi All,

Sorry,Some issues were opened before, but I still haven't solved this problem.

image
image

Result ;
image

So what's wrong? :/

Thanks,

does not work with DevOps Server

see title - the pipeline task never shows up although the installation suceeded.
Tested with fresh installation of Azure DevOps Server 2019 and 2019.1

How to provide destination path to create the file?

I tried with $(SolutionDir)temp/myfile.txt
I tried with $account/branch/temp/myfile.txt
None of them created the file in my desired path in the build workspace.
How to make it work?

Also I want to pass the content from a build custom variable. How to do it?
Thanks in advance.

Can not add multiple lines

Hi,
Whenever I try to add multiple lines like this.

ServerIp
BrowserName

It creates\overwrites the file like this
ServerIpBrowserName

Am I doing something wrong? Kindly let me know.

Add an option to skip creating file if content is empty

Hello,

First of all thank. you for the useful VSTS pipeline task.

I would like to request a change/feature that would allow task to skip creating file if content is empty.

Current behaviour is that the task failes with:
##[error]Unhandled: Input required: filecontent

screen shot 2019-03-07 at 17 11 39

The use case is that, I would like to generate the file with a content filled from Variable defined while queuing a new build. This variable is not mandatoryto fill and therefore making file content empty, this failing vsts-file-creator task.

Workaround: Set the pipeline to continue on task error. Not ideal, but works for now

SyntaxError: Block-scoped declarations

2019-08-26T22:45:07.5107021Z let filecontent = tl.getInput('filecontent', true);
2019-08-26T22:45:07.5107021Z ^^^
2019-08-26T22:45:07.5107021Z SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode

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.