Coder Social home page Coder Social logo

What is admin.deployCommand? about hexo-admin HOT 4 CLOSED

jaxonly avatar jaxonly commented on July 21, 2024
What is admin.deployCommand?

from hexo-admin.

Comments (4)

vladpurga avatar vladpurga commented on July 21, 2024 13

create deploy-script in project dir:
$ touch hexo-deploy.sh; chmod a+x hexo-deploy.sh

with such 2 lines for example or any custom code:

#!/usr/bin/env sh
hexo deploy

and edit _config.yml:

admin:
  deployCommand: './hexo-deploy.sh'

from hexo-admin.

grinka avatar grinka commented on July 21, 2024 1

I've found the like with deployCommand here: https://github.com/jaredly/hexo-admin/blob/8312967c7f707418dbb6ae5116e03292862d9dc4/api.js

use('deploy', function(req, res, next) {
    if (req.method !== 'POST') return next()
    if (!hexo.config.admin || !hexo.config.admin.deployCommand) {
      return res.done({error: 'Config value "admin.deployCommand" not found'});
    }
    try {
      deploy(hexo.config.admin.deployCommand, req.body.message, function(err, result) {
        console.log('res', err, result);
        if (err) {
          return res.done({error: err.message || err})
        }
        res.done(result);
      });
    } catch (e) {
      console.log('EEE', e);
      res.done({error: e.message})
    }
  });

I tried to fill the admin section with different values of this parameter - nothing seems to work. Unfortunately.

from hexo-admin.

grinka avatar grinka commented on July 21, 2024

image

I have the problem with admin.deployCommand too.

from hexo-admin.

pirtleshell avatar pirtleshell commented on July 21, 2024

This appears sufficiently answered thanks to @vladpurga. The deploy command is any command you'd like run on the terminal. Placing many commands in a bash script or batch file is a great way to do it.

Be aware that Windows does not use hashbangs (telling how to execute the file with the first line of a file, the #!/usr/bin/env sh in the example above). Thus, you'll need to play with what command will execute properly, perhaps by using a batch file or prefacing your hexo command with node.exe or some other Windows-recognized executable command.

from hexo-admin.

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.