Giter VIP home page Giter VIP logo

deploy-to-git's Introduction

Hi there ๐Ÿ‘‹

My name is Andrii (also Andrey) Gubanov. I live in the open-source universe since 2011. Most of my projects can be found on opensource.gubanov.eu. The latest one is Vovk.ts - REST API library for Next.js. Feel free to follow my Github profile and star my repos!

Become a Sponsor โ™ฅ๏ธ

GitHub Stats

Visitor count:

deploy-to-git's People

Contributors

finom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

deploy-to-git's Issues

use env variable for git auth

You don't want your git token checked into your code... this will allow others to publish to your project.

You should allow for a DEPLOYTOGIT_REPOSITORY environment variable, that way it can be encrypted in yoru travis.yml, or outside your codebase.

error message could be improved?

After reading the example, I added the required fields but forgot to nest the deployToGit object inside config object (should have been config.deployToGit in package.json).

The error didn't make sense, since it said I was missing "repository", yet I already had two "repository"s in the config - one for the npm general config and one I just added inside deployToGit.

Error I got:

$ deploy-to-git
<pkg>/node_modules/deploy-to-git/index.js:23
        throw Error(`deployToGit requires "${field}" field in package config`);
        ^

Error: deployToGit requires "repository" field in package config
    at Object.<anonymous> (<pkg>/node_modules/deploy-to-git/index.js:23:15)
    at Module._compile (module.js:660:30)
    ...

A simple fix might be this:

diff --git a/index.js b/index.js
index 37c923d..71aefcc 100755
--- a/index.js
+++ b/index.js
@@ -20,7 +20,7 @@ for (const [field, isRequired] of entries(fields)) {
     const configVar = process.env[`${variablePrefix}${field}`];
 
     if (!configVar && isRequired) {
-        throw Error(`deployToGit requires "${field}" field in package config`);
+        throw Error(`Package config is missing required field: "config.deployToGit.${field}"`);
     }

Then, error message is a bit more clear:

Error: Package config is missing required field: "config.deployToGit.repository"
    at Object.<anonymous> ...

(Or, to keep closer to original message, just change "${field}" to "config.deployOnGit.${field}")

Syntax problem

Hello,

I'm trying to use your module on
npm 3.10.10
visual studio code : powershell terminal
Windows 10

I have use the script normally, it clone and build perfectly.
But it doesn't execute any "execSync" starting with blank line.

The only way for me to make it work perfectly is to put everything on the same line.

Exemple if I want "push" to work I must change :

execSync(`
    cd ${config.folder} &&
    git push --tags ${config.repository} ${config.branch}
`, { cwd });

to :

execSync('cd ${config.folder} && git push --tags ${config.repository} ${config.branch}', { cwd });

anyway, thanks you for you job ;)

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.